Jump to content

Maria DB SQL problem


cobusbo
Go to solution Solved by 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
Share on other sites

  • Solution
$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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.