chriscloyd Posted January 3, 2007 Share Posted January 3, 2007 here is this plosable if not how could i do it?[code]<?php<?php$get_staff = mysql_query("SELECT * FROM users WHERE level = 'admin' AND level = 'staff' AND level = 'sales'");while ($staff_info = mysql_fetch_assoc($get_staff)) {$id = $staff_info['id'];$name = $staff_info['first'].' '.$staff_info['last'];$email = $staff_info['email'];echo '<tr><td><div align="center">'.$id.'</div></td><td><div align="center">'.$name.'</div></td><td><div align="center">'.$email.'</div></td><td><div align="center"><form name="form1" id="form1"><select name="menu1" onchange="MM_jumpMenu("parent",this,0)"><option>Commands</option><option value="staff.php?page=sales&aid='.$id.'">Convert To Sales</option><option value="staff.php?page=admin&id='.$id.'">Convert To Admin</option><option value="staff.php?page=staff&id='.$id.'">Convert To Staff</option><option value="staff.php?page=edit&id='.$id.'">Edit</option><option value="staff.php?page=delete&id='.$id.'">Delete</option><option value="staff.php?page=ban&id='.$id.'">Ban</option></select></form></div></td></tr>';}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/32764-mysql-and-php-query/ Share on other sites More sharing options...
trq Posted January 3, 2007 Share Posted January 3, 2007 Please, take the time to read the link in my signiture. Quote Link to comment https://forums.phpfreaks.com/topic/32764-mysql-and-php-query/#findComment-152542 Share on other sites More sharing options...
metrostars Posted January 3, 2007 Share Posted January 3, 2007 I don't know what you mean, could you write ir out in words. But What you are saying from the query above, is, that for a row to show, level has to equal 3 different things at the same time, which isn't possible.If you wanted to show the users where the level was EITHER staff, admin or sales, you would have to replace that query with:SELECT * FROM users WHERE level = 'admin' OR level = 'staff' OR level = 'sales'.That's what I think you meant. Quote Link to comment https://forums.phpfreaks.com/topic/32764-mysql-and-php-query/#findComment-152543 Share on other sites More sharing options...
Jessica Posted January 3, 2007 Share Posted January 3, 2007 thorpe, mind if I steal your signature? ;) I love that article. Quote Link to comment https://forums.phpfreaks.com/topic/32764-mysql-and-php-query/#findComment-152554 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.