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% Link to comment https://forums.phpfreaks.com/topic/297908-maria-db-sql-problem/ Share on other sites More sharing options...
cobusbo Posted August 23, 2015 Author 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` Link to comment https://forums.phpfreaks.com/topic/297908-maria-db-sql-problem/#findComment-1519505 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.