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

Tell me how can we define a variable accessible in functions of a php script?

994


What is the difference between php 5 and php 7?

1059


How can you create a session in php?

1117


Explain the difference between require() and require_once()?

1019


What are the differences between GET and POST methods?

1151


What are the advantages of oops in php?

1147


What is a php tag?

922


Explain the difference between array_merge() and array_combine()?

1054


What does $_env means?

985


What is the difference between indexed and associative array?

1073


What is the maximum size of a table in mysql?

1044


What is preg_match?

1027


What is null value in php?

1102


What is a namespace in php?

1007


What are the differences between php constants and variables?

1244