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 the use of mysqli_real_escape_string() function?

908


What is the use of php and mysql?

1019


Is php dying 2018?

946


Name some of the constants in php and their purpose.

977


What is button in html?

953


How is traits used in php?

986


How can we upload a file in php?

1006


Is php the same as html?

932


What are include() and require() functions?

950


What is a php form?

1009


Why constructor is not overridden?

994


Tell me how can we change the maximum size of the files to be uploaded?

970


How would you declare a function that receives one parameter name hello?

962


What is form submission?

983


How can we check the value of a given variable is alphanumeric?

977