Jump to content

excluding records in a query


jeff5656

Recommended Posts

When I run this query to exclude records where id = $userarray['id'],

 

$q = "SELECT * FROM users WHERE inst_id = '". $userarray['inst_id'] ."' AND id != '". $userarray['id'] ."' ";

 

 

it actually ONLY returns records with $userarray['id']  as opposed to excluding them.  Isn't the way to exclude them to use != ?

Link to comment
https://forums.phpfreaks.com/topic/210561-excluding-records-in-a-query/
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.