Home Tutorial Php Sql Php Sql num rows

 
 

Share on Google+Share on Google+
Php Sql num rows
Posted on: December 10, 2010 at 12:00 AM
Advertisement
This example illustrates how to find number of rows of the table.

Php Sql num rows

This example illustrates how to find number of rows of the table.

 In this example we create a php file in which we execute a query and find the number of rows of the table by mysql_num_rows methods. The output shown on the browser as below given.

 

Table:emp

 

Source Code of num_rows.php 

<?php
  $link = mysql_connect("localhost""root""root");
  mysql_select_db("test", $link);

  $result = mysql_query("SELECT * FROM emp", $link);
  $num_rows = mysql_num_rows($result);

  echo "<b>$num_rows Rows Found</b>";
?>

 

Output:

Advertisement

Related Tags for Php Sql num rows:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 10, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com