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
Who is known as the father of php?
Which programming language does php resemble to?
CWD is a type of shell variable. State Whether True or False?
Why do we use query?
What is php data type?
What is the use of pear in php?
What is abstract class in php?
What is mysql_fetch_row?
What is the meaning of ‘escaping to php’?
How to split a string into array using php?
How do you access a get requests url parameter with php?
What is the difference between include and require?
What is http get and post?
How to get elements in reverse order of an array in php?
Why many companies are switching their current business language to php? Where php basically used?