Rediculous php error, mysql blatantly lying to me. anyone help?
  • May 2009
    coud anyone help me to understand why this:

    $query  = \"
    SELECT Order.`Order Number`, Person.`Email Address`
    FROM `Order`, Person
    WHERE Order.InvoiceContactID = Person.ContactID
    AND Person.`Email Address`='{$sqlemail}'
    AND Order.`Order Number`='{$sqlpass}'
    \";


    gives this:
    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 'Order.`Order Number`, Person.`Email Address` FROM `Order`, Person WHERE Order.' at line 1


    i'm DAMN sure that the tables mentioned exist. i have seen them.

    Why doth the mysql tease me so?
     
  • June 2009
    Gabe, Have you sorted this? I'd look at those funny quote marks (`).
     
  • June 2009
    i'd go with Alan's suggestion

    they look wrong
     
  • DarrenDarren
     
    June 2009
    Thats exactly wht i was thinking :D
     
  • June 2009
    Darren said:
    Thats exactly wht i was thinking :D


    LOLOLOL
    surrrrrre you were (enjoy Chessington ;) )
     
  • GozGoz
     
    June 2009
    I've seen it written as

    [Order.Order Number]

    before. Not sure if that would work here but worth a try?
     
  • June 2009
    actually, after some revisiting of this problem, all of the abbove were right.

    the silly backticks were off, and so were the positioning of the squacketts. thats what i get for learning sql from the back of a cereal packet.

    thanks! :)