cobusbo Posted August 23, 2015 Share Posted August 23, 2015 $read1 = "unread"; $query = "INSERT INTO pm (username,mxitid,message,time,read,ip) VALUES (\"$naam\",\"$ip1\",\"$message\",\"$date\",\"$read1\",\"$banby2\")"; I'm getting the error Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'read,ip) VALUES (\"$naam\",\"$ip1\",\"$message\",\"$date\",\"$read1\",\"$banby2\' at line 1 This only happened when I added the read and value $read I got the field named read in my database.... any suggestion where im going wrong? If I remove the read field the rest of the query works 100% Quote Link to comment Share on other sites More sharing options...
Solution cobusbo Posted August 23, 2015 Author Solution Share Posted August 23, 2015 $read1 = "unread"; $query = "INSERT INTO pm (username,mxitid,message,time,read,ip) VALUES (\"$naam\",\"$ip1\",\"$message\",\"$date\",\"$read1\",\"$banby2\")"; I'm getting the error This only happened when I added the read and value $read I got the field named read in my database.... any suggestion where im going wrong? If I remove the read field the rest of the query works 100% Never mind did some further research and found that read is a reserved word had to change it to `read` 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.