Ok, I have a weird problem with my page... I'm putting info into my database from a form.
function save_game() {
$game_name = addslashes($_REQUEST['game_name']);
$contact = addslashes($_REQUEST['contact']);
$query = "INSERT INTO game_data (game_name, contact) VALUES ('$game_name','$contact')";
global $dbaddress;
global $dbuser;
global $dbpass;
global $dbname;
$dbc = new mysqli($dbaddress, $dbuser, $dbpass, $dbname);
$dbc->query($query) or die($dbc->error());
$dbc->close();
echo $query;
$content = "Game added successfully";
When I submit the data, it's inserted into the database, however MySQL spits back an error:
"INSERT INTO game_data (game_name, contact) VALUES ('Blah','Blah')You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1"
When I copy / paste the query into phpmyadmin, it works just fine.
Any clue what's going on here? This is on my Test server, which is running Debian64, Apache2, PHP5, and MySQL5.
Thanks!