Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Number of Rows Returned by query in php

Sun Oct 26, 2008 7:27 pm

Number of rows returned by query in php
Code:
<html>
<head>
<title>Using mysql_num_rows()</title>
</head>
<body>
<?php
$user 
"user";
$pass "password";
$db "userdb";
$link =  mysql_connect"server"$user$pass );

if ( ! 
$link ) {
    die( 
"Couldn't connect to MySQL" );
}

mysql_select_db$db$link ) or die ( "Couldn't open $db: ".mysql_error() );
$result mysql_query"SELECT * FROM Employee" );
$num_rows mysql_num_rows$result );

print 
"There are currently $num_rows rows in the table<P>";
mysql_close$link );
?>
</body>
</html>




Post a reply
  Related Posts  to : Number of Rows Returned by query in php
 convert integer number to octal,hexadecimal number systems     -  
 convert octal number to decimal number     -  
 convert decimal number to octal number     -  
 three rows frameset .     -  
 Select odd rows from table     -  
 Get affected rows for an update in php     -  
 delete duplicate rows in mysql using php     -  
 Multi colored table rows     -  
 different colors for table Even- Odd rows and Cells     -  
 Listing All Rows and Fields in a Table     -  

Topic Tags

PHP Database