Re: SELECT COUNT - result from two tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mark Gordon wrote:

Yes, query is definitely working without COUNT(*). Even in the most stripped down form, the query fails:

$sql = "SELECT COUNT(bandid), genre
FROM bands, genre";
$result=mysql_query($sql);
while ($gen=mysql_fetch_row($result)) {
echo $gen[1];
}

Fails how? If it echos zero, it's not failing; your query just isn't returning any rows (regardless whether you think it should or not).


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux