Creating a Variable From Two Others
<p>In the HTML table below, I would like to add a third column that equals $row["countSubmissions"] times 10 plus $row["countComments"].  How could I do this?</p>

<p>Thanks in advance,</p>

<p>John</p>

<pre><code>$sqlStr = "SELECT 
    l.loginid, 
    l.username, 
    COALESCE(s.total, 0) AS countSubmissions, 
    COALESCE(c.total, 0) AS countComments
FROM login l    
LEFT JOIN (
    SELECT loginid, COUNT(1) AS total 
    FROM submission 
    GROUP BY loginid
) s ON l.loginid = s.loginid
LEFT JOIN (
    SELECT loginid, COUNT(1) AS total 
    FROM comment 
    GROUP BY loginid
) c ON l.loginid = c.loginid
GROUP BY l.loginid
ORDER BY countSubmissions DESC 
LIMIT 10";

  $result = mysql_query($sqlStr);

$arr = array(); 
echo "&lt;table class=\"samplesrec1edit\"&gt;";
while ($row = mysql_fetch_array($result)) { 
    echo '&lt;tr&gt;';
    echo '&lt;td class="sitename1edit1"&gt;&lt;a href="http://www...com/.../members/index.php?profile='.$row["username"].'"&gt;'.stripslashes($row["username"]).'&lt;/a&gt;&lt;/td&gt;';
    echo '&lt;td class="sitename1edit2"&gt;'.stripslashes($row["countSubmissions"]).'&lt;/td&gt;';
    echo '&lt;td class="sitename1edit2"&gt;'.stripslashes($row["countComments"]).'&lt;/td&gt;';
    echo '&lt;/tr&gt;';
    }
echo "&lt;/table&gt;";
</code></pre>
