Page 1 of 1

Syntax error with WHERE

Posted: Mon Mar 03, 2008 5:03 pm
by jeff5656
I am new to this so I assume this is a very stupid error, but I have a field in my table called signoff_status and the type is ENUM. The values in enum are "s" or "a".

Here's the code:
$query = "SELECT patient_name, mrn, location, fellow, rcf_date, admission, consult_reason, impression, recs, comments ".
"FROM active_consults ORDER BY patient_name".
"WHERE signoff_status = 'a' ";

I get the error at the where line.

Basically I just want to display records that have an "a" in the signoff_status field.

Re: Syntax error with WHERE

Posted: Mon Mar 03, 2008 5:09 pm
by Benjamin
The where clause goes before the order by.

Re: Syntax error with WHERE

Posted: Mon Mar 03, 2008 5:19 pm
by jeff5656
Thank you that worked!