Jump to content

Query


jandrews3

Recommended Posts

I'm having trouble with the following query:

$query = "SELECT * FROM chs_students WHERE spanish = 0 and registerm = '' or spanish = 0 and registerf = '' ORDER BY lname, fname";

 

I modified it from the following query (which is functional):

$query = "SELECT * FROM chs_students WHERE spanish = 0 ORDER BY lname, fname";

 

Is the first query valid, or can I not use AND and OR in this manner? I'm trying to select only those entries whose spanish variable is zero and either whose registerf or registerm varibales are empty. Thanks.

Link to comment
https://forums.phpfreaks.com/topic/120069-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.