Jump to content

mysql and php query


chriscloyd

Recommended Posts

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]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.