mysql and php analytics [on hold]

Wednesday, November 4, 2015

I need help making this code work. Don't worry about the password or ip address.
The code keeps on saying failed



<?php
$log="[Server] Analytics: Client Opened: " . $_SERVER['PHP_SELF'] . " At: " . date("l dS \of F Y h:i:s A") . " With IP:" . $_SERVER['REMOTE_ADDR'];
$Logger = new mysqli("localhost","root","password","Troop");
// Check connection
if($Logger->connect_error) {
die("Connection failed: " . $Logger->connect_error);
}

$sqlLogger = "INSERT INTO ServerLog (Log) VALUES ('$log')";
if ($conn->query($sqlLogger) === TRUE) {
echo "Success";
} else {echo "Failed";echo $Logger->error;}
$Logger->close();
?>

0 comments:

Post a Comment