chriscloyd Posted December 14, 2006 Share Posted December 14, 2006 Can you get a mysql where u do it like this "WHERE level = 'sales', 'admin'heres my code[code]<?$sales = mysql_query("SELECT * FROM users WHERE level = 'sales', 'admin' ORDER BY first ASC");while ($s = mysql_fetch_assoc($sales)) { echo '<option value="'.$s['id'].'">'.$s['first'].' '.$s['last'].'</option>';}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/30606-solved-mysql_query/ Share on other sites More sharing options...
.josh Posted December 14, 2006 Share Posted December 14, 2006 select * from users where level in ('sales','admin') order by first asc Quote Link to comment https://forums.phpfreaks.com/topic/30606-solved-mysql_query/#findComment-140921 Share on other sites More sharing options...
chriscloyd Posted December 14, 2006 Author Share Posted December 14, 2006 if i want to order by frist name then last name how would i do that? Quote Link to comment https://forums.phpfreaks.com/topic/30606-solved-mysql_query/#findComment-140931 Share on other sites More sharing options...
artacus Posted December 14, 2006 Share Posted December 14, 2006 ORDER BY first, last Quote Link to comment https://forums.phpfreaks.com/topic/30606-solved-mysql_query/#findComment-140935 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.