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?

PHP Interview Question
PHP Interview Question

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";

Download PHP Interview Questions And Answers PDF

Previous QuestionNext 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?