Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $conn = new PDO($dsn);
- $GetAllData = $conn->prepare("SELECT a.plot_sub_usage, b.code_desc, c.code_desc, COUNT(*) as count
- FROM dc_plot a
- inner join t_setup_code b on a.plot_sub_usage = b.code_id
- inner join t_setup_code c on c.code_id = b.code_1
- GROUP BY a.plot_sub_usage, b.code_desc, c.code_desc
- ORDER BY a.plot_sub_usage");
- $GetAllData->execute();
- $allRecords = [];
- if($GetAllData->rowCount() > 0){
- while($AllData = $GetAllData->fetch(PDO::FETCH_ASSOC)){
- $allRecords[] = ($AllData);
- <tbody>
- <?php
- foreach($allRecords as $v){?>
- <tr>
- <td><?php echo $v['b.code_desc'];?></td>
- <td><?php echo $v['c.code_desc'];?></td>
- <td><?php echo $v['count'];?></td>
- </tr>
- <?php }?>
- </tbody>
Add Comment
Please, Sign In to add comment