Jump to content

where row in(ads,ssd,sfdsd);


desithugg

Recommended Posts

[code]
<?
$query = "SELECT * FROM table where belongs_to = '$logged_in_user' && id in($logged_in_user_p_1, $logged_in_user_p_2, $logged_in_user_p_3, $logged_in_user_p_4, $logged_in_user_p_5, $logged_in_user_p_6)";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){$count++;
$s_lv = $row['level'];
$s_id = $row['id'];
$s_pk = $row['item'];
echo "($s_id)Pokemon:$s_pk level:$s_lv<br>";
}
?>
[/code]
See that would get all the rows where the ID is equal to one of the variables
$logged_in_user_p_1, $logged_in_user_p_2, $logged_in_user_p_3, $logged_in_user_p_4, $logged_in_user_p_5, $logged_in_user_p_6
but i want it to fetch where ever the id is not equal to the variables.
$logged_in_user_p_1, $logged_in_user_p_2, $logged_in_user_p_3, $logged_in_user_p_4, $logged_in_user_p_5, $logged_in_user_p_6

I tried
where belogs_to = '$logged_in_user' && id !in(....)
where belogs_to = '$logged_in_user' && id in!(....)

but neither worked any ideas on how to do it?
Link to comment
https://forums.phpfreaks.com/topic/34177-where-row-inadsssdsfdsd/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.