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

Who is known as the father of php?

1059


Which programming language does php resemble to?

967


CWD is a type of shell variable. State Whether True or False?

1044


Why do we use query?

870


What is php data type?

914


What is the use of pear in php?

938


What is abstract class in php?

956


What is mysql_fetch_row?

991


What is the meaning of ‘escaping to php’?

1037


How to split a string into array using php?

1073


How do you access a get requests url parameter with php?

958


What is the difference between include and require?

935


What is http get and post?

970


How to get elements in reverse order of an array in php?

957


Why many companies are switching their current business language to php? Where php basically used?

884