Login | Register  

Counting records in PHP/mySQL

by Scud   Wednesday, July 04, 2007 Rating:
 Vote this news:


Following code samples, demonstrates how to count records in a MySQL database table. You may send parameters to query to display only selected range of rows.

<?php
 
  mysql_pconnect($server, $username, $password);
  mysql_select_db("articles_index") or die("Can not find database");
  
  $query = "select * from articles where catID = 4";
  $result = mysql_query($query);

  while ($row = mysql_fetch_array($result))
  {
   $count = $row["count"];
  }
 echo $count;

?>





Dotnetindex.com is listed with 411asp.net
Dotnetindex.com is listed with aspin.com
Dotnetindex.com is listed with jspin.com
PHP, ASP, .NET, JSP Resources, Reviews







page counter
Copyright © 2007 Powered by GNews Publisher Positive. All rights reserved. Contact Us - Load Time: 0.22 second(s)