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 Alidad@comcast.net Quote Link to comment 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 ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.