jwk811 Posted February 16, 2007 Share Posted February 16, 2007 $sql = "SELECT max(size) FROM products"; $result = dbQuery($sql); $row = mysql_fetch_assoc($result); extract($row); $size isnt an option? how can I get the number of the max size? (functions are fine, just simplified) Link to comment https://forums.phpfreaks.com/topic/38714-quick-problem/ Share on other sites More sharing options...
utexas_pjm Posted February 16, 2007 Share Posted February 16, 2007 $sql = "SELECT max(size) FROM products"; $result = dbQuery($sql); $row = mysql_fetch_assoc($result); extract($row); $size isnt an option? how can I get the number of the max size? (functions are fine, just simplified) SELECT max(size) AS max_size FROM products Now use max_size as the col name. Best, Patrick Link to comment https://forums.phpfreaks.com/topic/38714-quick-problem/#findComment-185976 Share on other sites More sharing options...
jwk811 Posted February 16, 2007 Author Share Posted February 16, 2007 aww i remember that now.. thanks! Link to comment https://forums.phpfreaks.com/topic/38714-quick-problem/#findComment-185978 Share on other sites More sharing options...
btherl Posted February 16, 2007 Share Posted February 16, 2007 max(size) on its own will give you a column named "max". But I always use AS with aggregates. Makes things neater Link to comment https://forums.phpfreaks.com/topic/38714-quick-problem/#findComment-186107 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.