php script assistance...

  • tiffix
  • Student
  • Student
  • User avatar
  • Posts: 65
  • Loc: kenya

Post 3+ Months Ago

hello everyone,
this is part of my code
Code: [ Select ]
<?php
    $resultz=mysql_query("select * from main_shares where id='$mnum' and timestamp >= '$sdate' and timestamp <= '$edate' order by date desc");
    echo mysql_error();
    //$row=mysql_num_rows($result);
    while($row1=mysql_fetch_array($resultz)){
        $amount = $row1['amount'];
        $id     = $row1['id'];
        $cdate  = $row1['date'];
?>
    <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
    <tr class="imgsd1">
    <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px"><?php echo $mnum;?></font>
    </td>
   <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px"><?php echo $cdate;?></font>
    </td>
    <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px"><?php echo number_format($amount,2);?></font>
    </td>
    </tr>
    </table>
<?php
}//end while
?>
 
  1. <?php
  2.     $resultz=mysql_query("select * from main_shares where id='$mnum' and timestamp >= '$sdate' and timestamp <= '$edate' order by date desc");
  3.     echo mysql_error();
  4.     //$row=mysql_num_rows($result);
  5.     while($row1=mysql_fetch_array($resultz)){
  6.         $amount = $row1['amount'];
  7.         $id     = $row1['id'];
  8.         $cdate  = $row1['date'];
  9. ?>
  10.     <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  11.     <tr class="imgsd1">
  12.     <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="left" height="8">
  13.         <font face='Arial, Helvetica, sans-serif' size="-1px"><?php echo $mnum;?></font>
  14.     </td>
  15.    <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  16.         <font face='Arial, Helvetica, sans-serif' size="-1px"><?php echo $cdate;?></font>
  17.     </td>
  18.     <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  19.         <font face='Arial, Helvetica, sans-serif' size="-1px"><?php echo number_format($amount,2);?></font>
  20.     </td>
  21.     </tr>
  22.     </table>
  23. <?php
  24. }//end while
  25. ?>
  26.  


when i execute this i get something like
Code: [ Select ]
<table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
<tr class="imgsd1">
<td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
    <font face='Arial, Helvetica, sans-serif' size="-1px">1</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">ANN W. KIHARA</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
            <font face='Arial, Helvetica, sans-serif' size="-1px">May 27, 2009</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">250.00</font>
</td>        
</tr>
</table>
<table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
<tr class="imgsd1">
<td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
    <font face='Arial, Helvetica, sans-serif' size="-1px">1</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">ANN W. KIHARA</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
            <font face='Arial, Helvetica, sans-serif' size="-1px">May 20, 2009</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">250.00</font>
</td>        
</tr>
</table>
<table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
<tr class="imgsd1">
<td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
    <font face='Arial, Helvetica, sans-serif' size="-1px">1</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">ANN W. KIHARA</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
            <font face='Arial, Helvetica, sans-serif' size="-1px">May 13, 2009</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">250.00</font>
</td>        
</tr>
</table>
<table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
<tr class="imgsd1">
<td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
    <font face='Arial, Helvetica, sans-serif' size="-1px">1</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">ANN W. KIHARA</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
            <font face='Arial, Helvetica, sans-serif' size="-1px">May 06, 2009</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">250.00</font>
</td>        
</tr>
</table>
<table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
<tr class="imgsd1">
<td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
    <font face='Arial, Helvetica, sans-serif' size="-1px">2</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">CATHERENE MUTURI</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
            <font face='Arial, Helvetica, sans-serif' size="-1px">May 27, 2009</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">500.00</font>
</td>        
</tr>
</table>
<table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
<tr class="imgsd1">
<td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
    <font face='Arial, Helvetica, sans-serif' size="-1px">2</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">CATHERENE MUTURI</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
            <font face='Arial, Helvetica, sans-serif' size="-1px">May 13, 2009</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">500.00</font>
</td>        
</tr>
</table>
<table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
<tr class="imgsd1">
<td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
    <font face='Arial, Helvetica, sans-serif' size="-1px">3</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">CHARLES N. KANG'ETHE</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
            <font face='Arial, Helvetica, sans-serif' size="-1px">May 20, 2009</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">100.00</font>
</td>        
</tr>
</table>
<table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
<tr class="imgsd1">
<td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
    <font face='Arial, Helvetica, sans-serif' size="-1px">4</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">DANIEL KIYO</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
            <font face='Arial, Helvetica, sans-serif' size="-1px">May 27, 2009</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">100.00</font>
</td>        
</tr>
</table>
<table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
<tr class="imgsd1">
<td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
    <font face='Arial, Helvetica, sans-serif' size="-1px">4</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">DANIEL KIYO</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
            <font face='Arial, Helvetica, sans-serif' size="-1px">May 20, 2009</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">100.00</font>
</td>        
</tr>
</table>
<table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
<tr class="imgsd1">
<td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
    <font face='Arial, Helvetica, sans-serif' size="-1px">4</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">DANIEL KIYO</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
            <font face='Arial, Helvetica, sans-serif' size="-1px">May 13, 2009</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">1,000.00</font>
</td>        
</tr>
</table>
<table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
<tr class="imgsd1">
<td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
    <font face='Arial, Helvetica, sans-serif' size="-1px">4</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">DANIEL KIYO</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
            <font face='Arial, Helvetica, sans-serif' size="-1px">May 06, 2009</font>
</td>
<td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
        <font face='Arial, Helvetica, sans-serif' size="-1px">100.00</font>
</td>        
</tr>
</table>
  1. <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  2. <tr class="imgsd1">
  3. <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
  4.     <font face='Arial, Helvetica, sans-serif' size="-1px">1</font>
  5. </td>
  6. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
  7.         <font face='Arial, Helvetica, sans-serif' size="-1px">ANN W. KIHARA</font>
  8. </td>
  9. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  10.             <font face='Arial, Helvetica, sans-serif' size="-1px">May 27, 2009</font>
  11. </td>
  12. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  13.         <font face='Arial, Helvetica, sans-serif' size="-1px">250.00</font>
  14. </td>        
  15. </tr>
  16. </table>
  17. <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  18. <tr class="imgsd1">
  19. <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
  20.     <font face='Arial, Helvetica, sans-serif' size="-1px">1</font>
  21. </td>
  22. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
  23.         <font face='Arial, Helvetica, sans-serif' size="-1px">ANN W. KIHARA</font>
  24. </td>
  25. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  26.             <font face='Arial, Helvetica, sans-serif' size="-1px">May 20, 2009</font>
  27. </td>
  28. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  29.         <font face='Arial, Helvetica, sans-serif' size="-1px">250.00</font>
  30. </td>        
  31. </tr>
  32. </table>
  33. <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  34. <tr class="imgsd1">
  35. <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
  36.     <font face='Arial, Helvetica, sans-serif' size="-1px">1</font>
  37. </td>
  38. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
  39.         <font face='Arial, Helvetica, sans-serif' size="-1px">ANN W. KIHARA</font>
  40. </td>
  41. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  42.             <font face='Arial, Helvetica, sans-serif' size="-1px">May 13, 2009</font>
  43. </td>
  44. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  45.         <font face='Arial, Helvetica, sans-serif' size="-1px">250.00</font>
  46. </td>        
  47. </tr>
  48. </table>
  49. <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  50. <tr class="imgsd1">
  51. <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
  52.     <font face='Arial, Helvetica, sans-serif' size="-1px">1</font>
  53. </td>
  54. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
  55.         <font face='Arial, Helvetica, sans-serif' size="-1px">ANN W. KIHARA</font>
  56. </td>
  57. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  58.             <font face='Arial, Helvetica, sans-serif' size="-1px">May 06, 2009</font>
  59. </td>
  60. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  61.         <font face='Arial, Helvetica, sans-serif' size="-1px">250.00</font>
  62. </td>        
  63. </tr>
  64. </table>
  65. <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  66. <tr class="imgsd1">
  67. <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
  68.     <font face='Arial, Helvetica, sans-serif' size="-1px">2</font>
  69. </td>
  70. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
  71.         <font face='Arial, Helvetica, sans-serif' size="-1px">CATHERENE MUTURI</font>
  72. </td>
  73. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  74.             <font face='Arial, Helvetica, sans-serif' size="-1px">May 27, 2009</font>
  75. </td>
  76. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  77.         <font face='Arial, Helvetica, sans-serif' size="-1px">500.00</font>
  78. </td>        
  79. </tr>
  80. </table>
  81. <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  82. <tr class="imgsd1">
  83. <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
  84.     <font face='Arial, Helvetica, sans-serif' size="-1px">2</font>
  85. </td>
  86. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
  87.         <font face='Arial, Helvetica, sans-serif' size="-1px">CATHERENE MUTURI</font>
  88. </td>
  89. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  90.             <font face='Arial, Helvetica, sans-serif' size="-1px">May 13, 2009</font>
  91. </td>
  92. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  93.         <font face='Arial, Helvetica, sans-serif' size="-1px">500.00</font>
  94. </td>        
  95. </tr>
  96. </table>
  97. <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  98. <tr class="imgsd1">
  99. <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
  100.     <font face='Arial, Helvetica, sans-serif' size="-1px">3</font>
  101. </td>
  102. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
  103.         <font face='Arial, Helvetica, sans-serif' size="-1px">CHARLES N. KANG'ETHE</font>
  104. </td>
  105. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  106.             <font face='Arial, Helvetica, sans-serif' size="-1px">May 20, 2009</font>
  107. </td>
  108. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  109.         <font face='Arial, Helvetica, sans-serif' size="-1px">100.00</font>
  110. </td>        
  111. </tr>
  112. </table>
  113. <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  114. <tr class="imgsd1">
  115. <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
  116.     <font face='Arial, Helvetica, sans-serif' size="-1px">4</font>
  117. </td>
  118. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
  119.         <font face='Arial, Helvetica, sans-serif' size="-1px">DANIEL KIYO</font>
  120. </td>
  121. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  122.             <font face='Arial, Helvetica, sans-serif' size="-1px">May 27, 2009</font>
  123. </td>
  124. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  125.         <font face='Arial, Helvetica, sans-serif' size="-1px">100.00</font>
  126. </td>        
  127. </tr>
  128. </table>
  129. <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  130. <tr class="imgsd1">
  131. <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
  132.     <font face='Arial, Helvetica, sans-serif' size="-1px">4</font>
  133. </td>
  134. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
  135.         <font face='Arial, Helvetica, sans-serif' size="-1px">DANIEL KIYO</font>
  136. </td>
  137. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  138.             <font face='Arial, Helvetica, sans-serif' size="-1px">May 20, 2009</font>
  139. </td>
  140. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  141.         <font face='Arial, Helvetica, sans-serif' size="-1px">100.00</font>
  142. </td>        
  143. </tr>
  144. </table>
  145. <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  146. <tr class="imgsd1">
  147. <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
  148.     <font face='Arial, Helvetica, sans-serif' size="-1px">4</font>
  149. </td>
  150. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
  151.         <font face='Arial, Helvetica, sans-serif' size="-1px">DANIEL KIYO</font>
  152. </td>
  153. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  154.             <font face='Arial, Helvetica, sans-serif' size="-1px">May 13, 2009</font>
  155. </td>
  156. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  157.         <font face='Arial, Helvetica, sans-serif' size="-1px">1,000.00</font>
  158. </td>        
  159. </tr>
  160. </table>
  161. <table style='border: 1px solid #000000; table-layout:fixed;' width="100%" height="8" bgcolor="#FAFAFA" >
  162. <tr class="imgsd1">
  163. <td style='border: 1px solid #000000; table-layout:fixed;' width='50px' align="center" height="8">
  164.     <font face='Arial, Helvetica, sans-serif' size="-1px">4</font>
  165. </td>
  166. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="left" height="8">
  167.         <font face='Arial, Helvetica, sans-serif' size="-1px">DANIEL KIYO</font>
  168. </td>
  169. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="center" height="8">
  170.             <font face='Arial, Helvetica, sans-serif' size="-1px">May 06, 2009</font>
  171. </td>
  172. <td style='border: 1px solid #000000; table-layout:fixed;' width='75px' align="right" height="8">
  173.         <font face='Arial, Helvetica, sans-serif' size="-1px">100.00</font>
  174. </td>        
  175. </tr>
  176. </table>


now i want if possible, after displaying all the payments for a single guy, for example Ann W. Kihara, The next row should display the totals of Ann then the loop to continue with the next guy and display their total.


like
ann w. kihara 250
ann w. kihara 250
total 500
daniel kiyo 100
daniel kiyo 100
total 200

Any assitance is appreciated. thanks. :wink:
  • Brenden
  • Born
  • Born
  • Brenden
  • Posts: 3

Post 3+ Months Ago

Your code doesn't match your output. Where's the part that prints the person's name?

To do this, the easiest way is to:
  • Order the sql output by the person's name, then the date
  • Make a $totalamount variable that resets to 0 for each person and increases by $amount for each transaction, showing the total just before changing to the next person
  • Make a $lastperson variable which compares its value to the current person's name to see if it has changed. If it has changed, print the totals, start a new table, reset $totalamount and update $lastperson to the new name

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: Liamw411 and 81 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.