SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard
    Join Date
    Jul 2006
    Location
    New Zealand
    Posts
    1,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL Error WHERE AND Clause problem with PHP

    Hi all,

    Its been ages since i have asked for programming help i have not done much in ages and trying to get back in to it anyway im wanting to work on my current projects however i run into a problem however not working the way i want and the error is an old ugly error ive attempted to look on the internet to try and solve this looking at tutorial but nothing i can find.


    error is this "Error: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 'read=0' at line 1)";

    What does that mean does this Query point out anything obivious to you?

    Query = "SELECT * FROM pms WHERE reciever='demo' AND read='0'";

    Not sure what the problem is here but i cant find anything wrong with it seems fine unless ive made a stupid error?

    Can anyone help me and help me refresh my memory?

    Thanks

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,495
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    READ is a reserved word: http://dev.mysql.com/doc/refman/5.6/...ved-words.html

    Change the column name, or put it in backticks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •