22 October 2008, 1:00 PM

Handy code to count number of rows in MySQL. I use the code to search return results of how many posts are in on Catergry on my blog.

$db_con = mysql_connect("localhost", "username", "password");
mysql_select_db("database", $db_con);

$result = mysql_query("SELECT * FROM post WHERE catergory='Example'"$db_con);
$num_rows = mysql_num_rows($result);

echo $num_rows;




We have a large portfolio of work we have completed for clients. Our portfolio always carries our current new iPhone applications. Take a look

Follow us on Twitter, We aim to provide Live Information - @olliekett
 

© OKD Limited 2010 | Contact Us
OKD Limited is a private registered company in England and Wales.
 
Ollie Kett Designs - Tracking System