Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How can we find the number of rows in a result set using PHP?

Answer Posted / sunil kumar

<?php //first establish connection with database
mysql_connect("localhost","root","");
mysql_select_db("demoprj");
// then write the query suppose our table is tbl_student
$sql_stu="select* from tbl_student";
$res_stu=mysql_query($sql_stu);
$rows_stu=mysql_num_rows($res_stu);
echo"number of rows in tbl_student are=".$rows_stu;
?>

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is mysql_fetch_object?

1053


How is a session id generated?

1003


Where is php code written?

990


Is null check in php?

992


What is string and its function?

968


How to remove values saved in the current session?

1041


Code to upload a file in PHP?

1032


What are the __construct() and __destruct() methods in a php class?

954


How to swap two variables without using 3rd temp variable.

914


Which will check if a function exists?

1078


How can php and html interact?

1051


Explain what does the unlink() function means?

1116


How to get a total number of rows available in the table?

979


what the new feature add in php 7.2?

975


Why ide is recommended for use while programming with php?

926