Jump to content

mysql_result


astralaaron
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...