I'm trying to build a page that will run a query so I won't have to log into My PHP Admin...I keep getting a T-String error and can't figure it out...help?
Thanks!
Kuni
<?php
require('../config/_config.php');
$sql1 = "SELECT DATE( expiresDate ) AS "Expires", description AS "Product", ProductID, COUNT( * ) AS "Num. Retailers"
FROM tblProdRetailer
LEFT JOIN tblProduct ON fProductID = ProductID
WHERE DATE( expiresDate ) > NOW( )
GROUP BY DATE( expiresDate ) , description
ORDER BY DATE( expiresDate ) , description
LIMIT 0 , 100";
$qry = $dao->prepare($sql1);
$qry->execute();
$qry->setFetchMode(PDO::FETCH_ASSOC);
$results1 = $qry->fetchALl();
$display .= '<table>';
$display .= '<tr>';
$display .= '<td style="padding: 5px;">Expires</td>';
$display .= '<td style="padding: 5px;">Product</td>';
$display .= '<td style="padding: 5px;">ProductID</td>';
$display .= '<td style="padding: 5px;">Num. Retailers</td>';
$display .= '</tr>';
foreach ($results1 as $row1)
{
$display .= '<tr>';
$display .= '<td style="padding: 5px;">'.sprintf('%06d', $row1['Expires']).'</td>';
$display .= '<td style="padding: 5px;">'.$row1['Product'].'</td>';
$display .= '<td style="padding: 5px;">'.$row1['ProductID'].'</td>';
$display .= '<td style="padding: 5px;" align="right">'.$row1['Num. Retailers'].'</td>';
$display .= '</tr>';
}
$display .= '</table>';
echo $display;