How can we find the number of rows in a result set using PHP?
$result = mysql_query($any_valid_sql, $database_link);
$num_rows = mysql_num_rows($result);
echo “$num_rows rows foundâ€;
How can we find the number of rows in a result set using PHP?
$result = mysql_query($any_valid_sql, $database_link);
$num_rows = mysql_num_rows($result);
echo “$num_rows rows foundâ€;
How many ways can we used to retrieve data in a result set of mysql using php?
1. Using mysql_fetch_row function. This will return an indexed array.
2. Using mysql_fetch_array function. Fetch a result row as an associative array, a numeric array, or both.
3. Using mysql_fetch_object function. This will return the result set as an object.
4. Using mysql_fetch_assoc function. This will Fetch a result row as an associative array