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?

Answers were Sorted based on User's Feedback



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

Answer / rajan vardawaj

Here is how can you find the number of rows in a result set
in PHP: $result = mysql_query($any_valid_sql,
$database_link); $num_rows = mysql_num_rows($result); echo
“$num_rows rows found”;

Is This Answer Correct ?    14 Yes 0 No

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

Answer / 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

More PHP Interview Questions

how to change the div background color on every refresh..guys can u help me out.

3 Answers  


which function used to get the number of days between two given dates in php

1 Answers  


How is it possible to propagate a session id?

0 Answers  


What is the functionality of the function html entities?

3 Answers  


How many bootable file in O/S - XP,2000, and 98. which are the files.

1 Answers   IBM,


List data types in PHP?

0 Answers  


What is the use of session and cookies in php?

0 Answers  


Why are sessions used?

0 Answers  


hi, i have knowledge about PHP/MYSQL,i am fresher M.Sc-IT 2009 pass out,any recruitment in PHP please let me know.

0 Answers  


What is mysql_fetch_object?

0 Answers  


Suppose your zend engine supports the mode <? ?> Then how can you configure your php zend engine to support <?php ?> Mode ?

0 Answers  


Are static variables final?

0 Answers  


Categories