mforan Posted October 16, 2007 Share Posted October 16, 2007 heres the code that is the supposed "problem" note, this code worked before this "mysql update" ? random if u ask me! $query = "INSERT INTO inspect SET cheat='$cheaterdetail[0]',mod='$cheaterdetail[1]',alliance='$cheaterdetail[2]'"; mysql_query($query) or die("Error: ".mysql_error()); } and the error: 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 'mod='mark',alliance=''' at line 1 Link to comment https://forums.phpfreaks.com/topic/73563-solved-strange-near-problem-after-server-admin-updated-mysql-version/ Share on other sites More sharing options...
roopurt18 Posted October 16, 2007 Share Posted October 16, 2007 MOD is a mysql reserved word. Try enclosing all of your full table and column names in back ticks, the unshifted tilde key. Link to comment https://forums.phpfreaks.com/topic/73563-solved-strange-near-problem-after-server-admin-updated-mysql-version/#findComment-371145 Share on other sites More sharing options...
charliemexican Posted October 16, 2007 Share Posted October 16, 2007 the right sintaxis for your query would be something like this: $query="INSERT INTO inspect(cheat,mod,alliance) VALUES('$cheaterdetail[0]','$cheaterdetail[1]','$cheaterdetail[2]')"; for the insert command on sql its better to specify the fields and later the values you are going to insert. Hope it helps! Link to comment https://forums.phpfreaks.com/topic/73563-solved-strange-near-problem-after-server-admin-updated-mysql-version/#findComment-371146 Share on other sites More sharing options...
mforan Posted October 16, 2007 Author Share Posted October 16, 2007 yer the mod label was the problem haha. thats random but doesn't surprise me. the new code is great, thanks man! Link to comment https://forums.phpfreaks.com/topic/73563-solved-strange-near-problem-after-server-admin-updated-mysql-version/#findComment-371148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.