Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
fatman
Forum Commoner
Posts: 47 Joined: Fri Jul 21, 2006 11:18 am
Location: Portugal
Post
by fatman » Thu Jul 27, 2006 8:03 pm
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";
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Thu Jul 27, 2006 8:13 pm
Code: Select all
SELECT * FROM myStats WHERE `no` > 1 AND `hosts` <> 'exludeMe' ORDER BY `no` DESC;
fatman
Forum Commoner
Posts: 47 Joined: Fri Jul 21, 2006 11:18 am
Location: Portugal
Post
by fatman » Thu Jul 27, 2006 8:23 pm
It makes perfect sense, but I would never have thought ...