Jump to content

Maria DB SQL problem


cobusbo

Recommended Posts

$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

$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`

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.