我在我的网站上有一个查询,如果没有结果,我想说点别的,而不是有一个空白页......
$sth = $conn->prepare("SELECT * FROM directory WHERE user_active != '' AND County = :county");
$sth->execute(array(':county' => $county));
$c = 1;
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
RETURNED DATA GOES HERE
$c++;
}