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

How to create a public static method in PHP?

994


Which function would you use to insert a record into a database in php?

1005


Is php dead 2019?

895


What is difference between mysql_connect and mysqli_connect?

967


How can we increase execution time of a php script?

899


What is difference between mysqli and mysql?

1011


What is PECL?

1154


What are the 3 types of sessions?

1000


Define object-oriented methodology?

981


How will you calculate days between two dates in PHP?

1035


Explain about looping in PHP?

1025


What is a session in php?

961


What happens if an expected input field was not submitted?

916


What are escaping characters?

912


Which function is used to read a single character from a file in PHP.

1008