什么都没有显示,也没有错误输出。我已经定义了$id
。有任何想法吗?
<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>