Topic: Query Failing

Ok... I have been at work all night (not working on this problem though tongue) and this is starting to annoy me now.

I have this bit of code...

$result = $db->query('SELECT subject FROM '.$db->prefix.'topics WHERE id='.$id) or error('Unable to fetch topic subject', __FILE__, __LINE__, $db->error());

When a topic has been deleted it gives me the "unable to fetch topic subject" error instead of the normal "message(Bad request)" error.

Come on, someone point out the obvious for me... please....

Blog - Follow Me and FluxBB on Twitter

Re: Query Failing

('SELECT subject FROM '.$db->prefix.'topics WHERE id='.$id ) its that bit (so i think)

could be '.$id.' ')
or just with the '.$id ')

Last edited by Utchin (2008-04-11 10:02:48)

Sorry. Unactive due to personal life.

Re: Query Failing

matt: No, that code is perfectly fine.
StevenBullen: You need to give us context, what file/around what line?

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: Query Failing

Enable PUN_SHOW_QUERIES and paste the query. I guess the id is missing...

Re: Query Failing

lie2815 wrote:

I guess the id is missing...

Correct! big_smile

User error on my part... sad

Last edited by StevenBullen (2008-04-11 17:26:28)

Blog - Follow Me and FluxBB on Twitter

Re: Query Failing

StevenBullen wrote:
lie2815 wrote:

I guess the id is missing...

Correct! big_smile

User error on my part... sad

Nice to know I'm not the only one who does that trick on occasion. big_smile