Re: mmmmm SELECT

From: Date: Tue, 07 Jan 2003 02:19:10 +0000
Subject: Re: mmmmm SELECT
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-130523@lists.php.net to get a copy of this message
Your SQL statement is selecting from two tables, it doesn't know which table the 'active' column belongs to. Try one of the following as appropriate to your schema: tasks.active="yes" or users.active="yes" HTH, Jason k Larson Bruce Levick wrote:
I have this silly problem. This select query works fine. #################################################### $query_retrievetasks = "SELECT * FROM tasks, users WHERE tasks.UID = users.User_id ORDER by tasks.ID"; #################################################### But when I add a further filter (AND active="yes") ....it comes up blank...currently all the active rows in the tasks table are equal to "yes" so they should still display, but comes up with a blank. #################################################### $query_retrievetasks = "SELECT * FROM tasks, users WHERE tasks.UID = users.User_id AND active="yes" ORDER by tasks.ID"; #################################################### Can't understand this, is it just something simple I am missing?? Cheers


« previous php.general (#130523) next »