I have the following two mysql_queries
:
1.
$primary_img_query = "SELECT imgWidth, imgHeight FROM primary_images WHERE imgId=$imgId";
$primary_img_data = mysql_query($primary_img_query) or die('MySql Error' . mysql_error());
2.
$secondary_img_query = "SELECT imgWidth, imgHeight FROM secondary_images WHERE primaryId=$imgId";
$secondary_img_data = mysql_query($secondary_img_query) or die('MySql Error' . mysql_error());
What I need to do is find the largest value of both imgWidth
and imgHeight
from each query, and then find the largest value between the two found values. I need both said largest values to end up in variables.
All values in imgWidth
and imgHeight
are positive integers greater than zero.
Thanks for any help you can provide.
I was thinking I could put the results from both imgWidth
and imgHeight
in each query in separate arrays, then combine the arrays, and use max()
to find the largest(highest) value. Would that work?