Note that there are some explanatory texts on larger screens.

plurals
  1. POCreate a monthly records tables from different scripts
    text
    copied!<p>I would like to ask for some idea support how to achieve to create a table from 5 different MYSQL scripts in PHP. The result of each of them is SUM of data group by months. I do not want to vast time much to scripts because all of them are ok when activates alone. </p> <p>I will put theoretical query in order to not make my message very long.</p> <pre><code>&lt;?php $qry = "SUM(CASH) group by MONTH DESC"; $result=mysql_query($qry) or die(mysql_error()); $qry2 = "SUM(DEBT) group by MONTH DESC"; $result=mysql_query($qry2) or die(mysql_error()); $qry3 = "SUM(DEBTPAID) group by MONTH DESC"; $result=mysql_query($qry3) or die(mysql_error()); $qry4 = "SUM(INVOICE) group by MONTH DESC"; $result=mysql_query($qry4) or die(mysql_error()); $qry5 = "SUM(NVOICEPAYOFF) group by MONTH DESC"; $result=mysql_query($qry5) or die(mysql_error()); ?&gt; </code></pre> <p>I want to achieve a TABLE like this:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt;CASH&lt;/td&gt; &lt;td&gt;DEBT&lt;/td&gt; &lt;td&gt;DEBTPAID&lt;/td&gt; &lt;td&gt;INVOICE&lt;/td&gt; &lt;td&gt;INVOICEPAYOFF&lt;/td&gt; &lt;/tr&gt; &lt;? echo '&lt;tr&gt;'; echo '&lt;td&gt;&lt;label&gt;'. $row['CASH'] .'&lt;/label&gt;&lt;/td&gt;'; echo '&lt;td&gt;&lt;label&gt;'. $row2['DEBT'] .'&lt;/label&gt;&lt;/td&gt;'; echo '&lt;td&gt;&lt;label&gt;'. $row3['DEBTPAID'] .'&lt;/label&gt;&lt;/td&gt;'; echo '&lt;td&gt;&lt;label&gt;'. $row4['INVOICE'] .'&lt;/label&gt;&lt;/td&gt;'; echo '&lt;td&gt;&lt;label&gt;'. $row5['INVOICEPAYOFF'] .'&lt;/label&gt;&lt;/td&gt;'; echo '&lt;/tr&gt;'; ?&gt; &lt;/table&gt; </code></pre> <p>I will appreciete your every idea, solutions or recommendation. Thank you in advance! </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload