Created
February 16, 2010 02:03
-
-
Save weatheredwatcher/305212 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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