PHP: Find largest value from results of two MySQL database queries
<p><strong>I have the following two <code>mysql_queries</code>:</strong></p>

<p><strong>1.</strong></p>

<pre><code>$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());
</code></pre>

<p><strong>2.</strong></p>

<pre><code>$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());
</code></pre>

<p>What I need to do is find the largest value of both <code>imgWidth</code> and <code>imgHeight</code> 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.</p>

<p>All values in <code>imgWidth</code> and <code>imgHeight</code> are positive integers greater than zero.</p>

<p>Thanks for any help you can provide.</p>

<hr>

<p>I was thinking I could put the results from both <code>imgWidth</code> and <code>imgHeight</code> in each query in separate arrays, then combine the arrays, and use <code>max()</code> to find the largest(highest) value. Would that work?</p>
