On Sat, 2003-11-01 at 12:26, Frank Keessen wrote: > O.K. > > When i do this: > > <? > // open database connection > $connection = mysql_connect($host, $user, $pass) or die ("Unable to > connect!"); > // select database > mysql_select_db($db) or die ("Unable to select database!"); > > $query = "SELECT markhow, COUNT(*) FROM prospects GROUP BY markhow"; > $result = mysql_query($query) or die ("Error in query: $query. " . > mysql_error()); > while ($row = mysql_fetch_assoc($result)) > { > echo $row['markhow']; > } > > O.k. This is working.. Can someone tell me how to retrieve the COUNT > function?
Use 'COUNT(id) AS count_result', then you can access the value with $row['count_result']; -- Regards, Filip de Waard Net Collective www.netcollective.nl Tel. 06 - 48 01 22 40 Fax. 013 - 455 87 53 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php