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
Explain $_FILES Superglobal Array?
How can we submit form without a submit button?
What are headers in php?
What is http php?
Does facebook use php framework?
What are the rules to declare a php variables?
Explain what is the use of "echo" in php?
What does the unlink() function means?
Tell me how can we display information of a variable and readable by human with php?
Tell me what library is used for pdf in php?
What are some new features introduced in php7?
Which parts of php are case sensitive?
Is it more secure to use cookies to trfer session ids?
How to submit form without a submit button.
What does empty mean in php?