【发布时间】:2013-07-19 13:57:20
【问题描述】:
是否有可能找到最后一个循环是什么时候:
$stmt = $connection->stmt_init();
if ($stmt->prepare("SELECT `ProductId` FROM Products"))
{
$stmt->execute();
$stmt->bind_result($product_id);
while($stmt->fetch())
{
if ($lastloop)
{
echo 'The last id is -> ';
}
echo $product_id.'<br />';
}
}
我想输出类似:
1
2
...
9
最后一个id是-> 10
【问题讨论】:
标签: php mysqli while-loop prepared-statement