Nothing is showing, and no error is output. I have defined $id
. Any ideas?
<tr>
<td width="160">Price:</td>
<?php
dbconnect();
$stmt2 = $conn->prepare("SELECT Length, price FROM Product WHERE ProdID=:id LIMIT 1");
$stmt2->bindParam('id',$id);
$stmt2->execute();
$i = 0;
foreach ($stmt2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
if ($i == 0) {
echo '<td>'.$row2['Price'].'</td>';
}
}
?>
</tr>