paulman888888 Posted June 2, 2008 Share Posted June 2, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/108406-solved-error-please-help/ Share on other sites More sharing options...
almightyegg Posted June 2, 2008 Share Posted June 2, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/108406-solved-error-please-help/#findComment-555732 Share on other sites More sharing options...
paulman888888 Posted June 2, 2008 Author Share Posted June 2, 2008 what have you changed? Quote Link to comment https://forums.phpfreaks.com/topic/108406-solved-error-please-help/#findComment-555738 Share on other sites More sharing options...
revraz Posted June 2, 2008 Share Posted June 2, 2008 The error is coming from the Comma after thetime Quote Link to comment https://forums.phpfreaks.com/topic/108406-solved-error-please-help/#findComment-555739 Share on other sites More sharing options...
almightyegg Posted June 2, 2008 Share Posted June 2, 2008 And the comma after the last value. Just copy and past that it and see if you get any more errors Quote Link to comment https://forums.phpfreaks.com/topic/108406-solved-error-please-help/#findComment-555741 Share on other sites More sharing options...
paulman888888 Posted June 2, 2008 Author Share Posted June 2, 2008 thankyou guys so much. It works. Quote Link to comment https://forums.phpfreaks.com/topic/108406-solved-error-please-help/#findComment-555757 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.