php - Balance is not showing -


enter image description here

here code:

<table width="50%" border="2" bordercolor="green">     <tr>         <th>itemname</th>         <th>balance</th>     </tr>       <?php       if($qw="select distinct(itemname) details date(date)<='$date' order date desc"){       $qq = mysqli_query($con,$qw);       while($r=mysqli_fetch_array($qq,mysqli_assoc))       {         ?>         <tr>         <td><?php echo $r['itemname']; ?></td>         <td><?php echo $r['balance']; ?></td>         </tr>         <?php       }       }       ?>       </table> 

the given code fetch product itemname balance not fetch database.

your query not include 'balance' field.
change query include it:

select distinct itemname, balance details ... 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -