The following SQL script works in SQL Editor in phpMyAdmin. However, in PHP I cannot get this script to display real content online. It is all blank. The problem is somewhere in my echo. I tried using $row['a.qty']
but that did not work.
$sql = "SELECT a.qty + b.qty - c.qty as 'QTY', a.part_num as 'Part Num', a.part_desc as 'Description'
FROM Inv_Physical_Count a,
Inv_Restock b,
Inv_Orders c
WHERE a.part_id = b.part_id
AND a.part_id = c.part_id
ORDER BY a.order_form_seq";
$q = $pdo->prepare($sql);
$q->execute(array());
while ($row = $q->fetch(PDO::FETCH_ASSOC))
{
echo '<tr>';
echo '<td>' . $row['qty'] . '</td>';
echo '<td>' . $row['part_num'] . '</td>';
echo '<td>' . $row['part_desc'] . '</td>';
}