Skip to content

Instantly share code, notes, and snippets.

@weatheredwatcher
Created February 16, 2010 02:03
Show Gist options
  • Save weatheredwatcher/305212 to your computer and use it in GitHub Desktop.
Save weatheredwatcher/305212 to your computer and use it in GitHub Desktop.
<?php
class Log{
var $page_location;
var $log_msg;
function set_page($page_location){
$this->page_location = $page_location;
}
function set_log($log_msg){
$this->log_msg = $log_msg;
}
function write_log(){
$host = 'localhost';
$username = 'root';
$password = 'password';
$database = 'database';
mysql_connect($host, $username, $password);
mysql_select_db($database);
$page_location = $this->page_location;
$log_msg = $this->log_msg;
$results=mysql_query("INSERT INTO tbl_LOG (page_location, log_msg) VALUES('$page_location', '$log_msg')")or die(mysql_error());
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment