Hi guys, im intermediate SQL / PHP Dev, but I never did this, so I lost a bit.
Trying to grab the MAX column number of an INT column. When I run the query in PHPMYADMIN, it works fine, but when I put it in my PHP code, it keeps returning 0. I think my problem is that I don’t know how to extract it from the query correctly. In particular, I use mysql_result, but after reading its syntax, I don't know if you can do it this way.
Here is what i got
$query="SELECT MAX(`imageOrder`) FROM images where `gallery` = '$originalGallery'";
$result=mysql_query($query);
$num=mysql_numrows($result);
I know the above works, but here I am lost. How to get MAX ( imageOrder) in a PHP variable?
$topOrder=mysql_result($result,0);
Does not work
$topOrder=mysql_result($result,$i,MAX(`imageOrder`));
Doesn't work (BTW loop here)
, , , , ... Im .... 2
?
Craig