MadDawgX Posted February 5, 2007 Share Posted February 5, 2007 Hey there. What's wrong with the following syntax: $qPost = "INSERT INTO chat (cat,by,rank,mes) VALUES ('$ChatPage','$LogUsername','$LogRank','$NewChat')"; $rPost = mysql_query($qPost) or die('Query failed. ' . mysql_error()); It's throwing: Query failed. 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 'by,rank,mes) VALUES ('1','AlcanderX','4','Test')' at line 1 Quote Link to comment Share on other sites More sharing options...
btherl Posted February 5, 2007 Share Posted February 5, 2007 It's probably a reserved word.. try INSERT INTO chat (cat,`by`,rank,mes) ... Quote Link to comment Share on other sites More sharing options...
fenway Posted February 5, 2007 Share Posted February 5, 2007 Better yet, pick a better column name. Quote Link to comment 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.