Aidam-Unlimited
asked on
[MySQL+PHP] SELECT -> Ignore condition if zero rows?
Hi,
I have this example mysql_query:
mysql_query("SELECT * FROM table WHERE id='$id' AND name NOT IN($names)");
Is there any option in mysql_query to get results even if this returns Zero rows, i.e. run query ignoring that second condition?
I know it's easy to use PHP if() but I'm just curious whether is possible to do it inside one mysql_query.
Thanks for ideas!
I have this example mysql_query:
mysql_query("SELECT * FROM table WHERE id='$id' AND name NOT IN($names)");
Is there any option in mysql_query to get results even if this returns Zero rows, i.e. run query ignoring that second condition?
I know it's easy to use PHP if() but I'm just curious whether is possible to do it inside one mysql_query.
Thanks for ideas!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER