Results 1 to 2 of 2

Thread: Odd sql problem - Please help!

  1. #1
    Join Date
    Apr 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Odd sql problem - Please help!

    I created a database for a watercolor site, and for the past several years it has been working perfectly. There is a membership roster that shows all members, and within that is a further query where certain members have detailed pages that display their paintings and bio. Suddenly in March the query simply stopped working, and the detail page just shows blank white where the info used to be.
    Here's the query:
    Code:
    "SELECT * FROM roster WHERE ID = '$ID' AND enhanced = 'y'"
    I've confirmed that the database info is all still intact, and if I change the query to remove the ID stuff, it displays, but using the ID part (in Dreamweaver) it shows "no data" when testing.
    I called my hosting company and confirmed that they didn't change anything on their end either.
    I've been staring at this, baffled, for days now, and cannot figure out what could've happened.

    Any help would be GREATLY appreciated!

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    You always wanna tap things that arn't mysql clauses, then you wanna include the { and } before and after your variables:
    Code:
    "SELECT * FROM `roster` WHERE `ID` = '{$ID}' AND `enhanced` = 'y'"
    Also make sure that its `ID` not `id`.
    Hope this Helps,
    Nile
    Jeremy | jfein.net

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
  •