PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
hanzo
Forum Newbie
Posts: 16 Joined: Thu Nov 17, 2005 10:14 am
Post
by hanzo » Wed Dec 28, 2005 1:14 pm
Code: Select all
$query = "SELECT `name` FROM `users` WHERE product = 'ipod video 60gb'AND activated = '1' ORDER BY `order` ASC";
I have this query but it should also return rows where activated = 2 how do I do that?
Thanks
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Wed Dec 28, 2005 1:16 pm
Code: Select all
$query = "SELECT `name` FROM `users` WHERE product = 'ipod video 60gb' AND (activated = '1' or activated = '2') ORDER BY `order` ASC";
hanzo
Forum Newbie
Posts: 16 Joined: Thu Nov 17, 2005 10:14 am
Post
by hanzo » Wed Dec 28, 2005 1:17 pm
thanks
dreamline
Forum Contributor
Posts: 158 Joined: Fri May 28, 2004 2:37 am
Post
by dreamline » Thu Dec 29, 2005 8:50 am
A little bit shorter would be:
Code: Select all
$query = "SELECT `name` FROM `users` WHERE product = 'ipod video 60gb' AND activated in ('1','2') ORDER BY `order` ASC";
Just my 2 cents..