Jump to content

[SOLVED] ERROR PLEASE HELP


paulman888888

Recommended Posts

I have made my code but i get an error. Below is my code.

<?php
$ip = $_SERVER['REMOTE_ADDR'];
$today = date("m.d.y");
$time = time("H"); 
// Insert a row of information into the table "myscore2"
mysql_query("INSERT INTO myscore2 
(name, score, gameid, mode, thedate, thetime, ) VALUES('" . mysql_real_escape_string(substr($_GET['name'], 0, 13)) . "', '" . mysql_real_escape_string($_GET['score']) . "', '" . mysql_real_escape_string($_GET['gameid']) . "', '" . mysql_real_escape_string($_GET['mode']) . "', '" . mysql_real_escape_string('{$today}') . "', '" . mysql_real_escape_string('{$time}') . "', '" . mysql_real_escape_string('{$ip}') . "', )") 
or die(mysql_error());  
echo "Score Uploaded!#";
?>

and i get this error

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 ') VALUES('testing1111', '9999', '444', '1', '{$today}', '{$time}

 

What am i doing wrong?

 

Thankyou

Link to comment
https://forums.phpfreaks.com/topic/108406-solved-error-please-help/
Share on other sites

mysql_query("INSERT INTO myscore2 
(name, score, gameid, mode, thedate, thetime) VALUES('" . mysql_real_escape_string(substr($_GET['name'], 0, 13)) . "', '" . mysql_real_escape_string($_GET['score']) . "', '" . mysql_real_escape_string($_GET['gameid']) . "', '" . mysql_real_escape_string($_GET['mode']) . "', '" . mysql_real_escape_string('{$today}') . "', '" . mysql_real_escape_string('{$time}') . "', '" . mysql_real_escape_string('{$ip}') . "')") 
or die(mysql_error());  

 

Try that

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.