Jump to content

mysql_result


astralaaron

Recommended Posts

$sql2 = "SELECT COUNT(*) FROM storage";$result2 = mysql_query($sql2);$count = mysql_result($result2, 0);the mysql_result does not work like this mysql_result($result2);why does it work when it is written mysql_result($result2, 0); ?? what is the number for?i tried changing the number to a 1 or 2 and it returned this error:Warning: mysql_result() [function.mysql-result]: Unable to jump to row 2 on MySQL result index 4 in C:\wamp\www\practice\mysql_array1.php on line 10I am just trying to understand how mysql_result works. I am reading on php.net but it is not helping much

Link to comment
Share on other sites

Hi..in manual there is syntax as following mixed mysql_result (resource result, int row [, mixed field])second parameters indicate row number..Regards,Vijay

Link to comment
Share on other sites

Hi..in manual there is syntax as following mixed mysql_result (resource result, int row [, mixed field])second parameters indicate row number..You will having only one row as u r only geeting count,so except '0'(zero row) you have an error...Regards,Vijay

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...