Log in

View Full Version : Odd sql problem - Please help!



barleywine
04-24-2008, 05:24 PM
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:

"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!

Nile
04-24-2008, 10:03 PM
You always wanna tap things that arn't mysql clauses, then you wanna include the { and } before and after your variables:


"SELECT * FROM `roster` WHERE `ID` = '{$ID}' AND `enhanced` = 'y'"

Also make sure that its `ID` not `id`.
Hope this Helps,
Nile :D