0
我使用此代码从数据库中获取行。检查预处理语句PDO的结果?
// Prepare WC statement
$queryUP = $pdo->prepare("SELECT * FROM unitprices WHERE id_quot = :idQuotation");
// Execute Unit prices statement
$queryUP->execute(array(
'idQuotation' => $idQuotation
));
// How to check the results is empty or not ?
if (results) {
// foreach($queryUP as $rowup) {
//...
// }
} else {
// do another thing
}
我不知道如何在继续执行代码之前检查查询中是否存在一些结果?
为什么这是错的,如果做的foreach进? – wawanopoulos
如果您在回路中回显任何内容,则意味着模板不是用途,而应该是。 –
什么是你的模板? – wawanopoulos