Basic PHP Programming Question:
Download Job Interview Questions and Answers PDF
How can we find the number of rows in a result set using PHP?
Answer:
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";
$result = mysql_query($any_valid_sql, $database_link);
$num_rows = mysql_num_rows($result);
echo "$num_rows rows found";
Download PHP Interview Questions And Answers
PDF
Previous Question | Next Question |
What is the difference between md5(), crc32() and sha1() crypto on PHP? | How many ways we can we find the current date using MySQL? |