#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0

    Error sql syntax 4.1 -> 5.5.24


    I got this old system from a client, the company who did it don't exist anymore.

    When I tried to move from the really old server to a new one I got this error in the apache2 error log. Guess it something about going from mysql 4.1 to 5.5.24.
    -----------------------------------
    PHP Fatal error: MySQL Error 1064: 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 'schema s, booking b, prod p WHERE b.bid=s.booking_id AND p.pid=b.prod_id AND s.f' at line 1,

    Last query: [query] SELECT p.pid, p.have_img, p.img_ext FROM schema s, booking b, prod p WHERE b.bid=s.booking_id AND p.pid=b.prod_id AND s.format_id=1 AND s.year='2013' AND s.week='12'
    -----------------------------

    /benny
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Hi,

    "SCHEMA" is a reserved word in MySQL 5.5. You could wrap the name in backticks `` to mark it as an identifier, but that would be a very ugly workaround. If possible, rename it. It's a really, really bad name for an SQL table, because "schema" has a special meaning in the database world.
    The 6 worst sins of security How to (properly) access a MySQL database with PHP

    Why cant I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo