Alidad Posted November 16, 2007 Share Posted November 16, 2007 I have project relate to directory, let say that i have few catagories, and sub-catagories. let say that in database have seven catagoreis relate to California in database, my question is that how do i can write query in mysql to show total count of California! for sample "California(7)", (7) mean total sum count in database for california, how do i can write that query in mysql! please help thanks. Alidad Modjtabai [email protected] Link to comment https://forums.phpfreaks.com/topic/77555-need-help-with-mysql/ Share on other sites More sharing options...
pocobueno1388 Posted November 16, 2007 Share Posted November 16, 2007 <?php $query = mysql_query("SELECT COUNT(*) as num FROM table WHERE category='California'"); $row = mysql_fetch_assoc($query); echo $row['num']; //<-- This will echo out how many rows ?> Link to comment https://forums.phpfreaks.com/topic/77555-need-help-with-mysql/#findComment-392562 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.