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
What is the use of mysqli_real_escape_string() function?
What is the use of php and mysql?
Is php dying 2018?
Name some of the constants in php and their purpose.
What is button in html?
How is traits used in php?
How can we upload a file in php?
Is php the same as html?
What are include() and require() functions?
What is a php form?
Why constructor is not overridden?
Tell me how can we change the maximum size of the files to be uploaded?
How would you declare a function that receives one parameter name hello?
What is form submission?
How can we check the value of a given variable is alphanumeric?