RE: [PHP] Won't return results for 0 matches

From: Date: Tue, 18 Jul 2000 18:21:23 +0000
Subject: RE: [PHP] Won't return results for 0 matches
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7118@lists.php.net to get a copy of this message
If memory serves me correctly (and I believe that it does): If you are doing a count on (in this case, a set of numbers), and those numbers do not actually have rows in the table, you will not get Pick: 11 Count: 0 Pick:24 Count: 0 In fact, you will get nothing at all (hence why your query is failing). Try running this query against your database from the command line and see if you get back the results that you are expecting. Since the same query will be passed from your PHP page, you will get the same results back as if you entered the SQL statement from the command line. Sam Masiello System Analyst Chek.Com (716) 853-1362 x289 smasiello@chekinc.com -----Original Message----- From: CDitty [mailto:mail@redhotsweeps.com] Sent: Tuesday, July 18, 2000 2:12 PM To: php-general@lists.php.net Subject: [PHP] Won't return results for 0 matches Does anyone see anything wrong with this statement as to why it won't return those that didn't match? It works for 1-whatever, but not for 0. I have physically verified that there are a few entries that have 0 matches in them. select count(pick) as cnt, ticket from archivepicks where pick IN (11, 24, 29, 41, 49, 52) group by ticket having count(pick) = 0"; Any help is appreciated. Thanks CDitty -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#7118) next »