Page 1 of 1

Read all records except specified ...

Posted: Thu Jul 27, 2006 8:03 pm
by fatman
I want to read all records in the DB excluding a specified value contained in a field called 'host' in the following query, with a supplied value e.g.: '$ip_adress':

Code: Select all

$query_myStats = "SELECT * FROM myStats WHERE `no` > 1 ORDER BY `no` DESC";

Posted: Thu Jul 27, 2006 8:13 pm
by Benjamin

Code: Select all

SELECT * FROM myStats WHERE `no` > 1 AND `hosts` <> 'exludeMe' ORDER BY `no` DESC;

Thanks, perfect

Posted: Thu Jul 27, 2006 8:23 pm
by fatman
It makes perfect sense, but I would never have thought ...