SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RANGE as a table column

    I've recently upgraded from MySQL 5.0.51b to 5.1.36 and am having troubles with one of my tables. More specifically, one of the columns in that table, called Range. In the older version, it had no trouble recognizing it as a column name, but in the newer version, it seems to have become reserved or something.

    It had no trouble importing the table when I upgraded, but when I do any sort of sql query (both in phpMyAdmin and my own PHP code), it throws out errors. To be exact, this 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 'Range FROM ItemTable LIMIT 0, 30' at line 1

    Should I just alter the column name and my code, or is there something in the my.ini file that is making my queries go wonky?

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    If it's a reserved word, you can put it between backticks. Or you can rename your column.


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
  •