0
爲什麼fetchColumn()
在數據庫中實際存在兩列符合這些條件時會返回「1」?爲什麼fetchColumn()在有2列時返回1?
如果數據庫中有1條記錄匹配,它將返回false? (我以前做$num_of_rows = $stmt->num_rows()
它完美地工作)
$follower = 1;
$following = 1;
$stmt = $dbCon->prepare(" SELECT login_followers_status "
. " FROM login_followers "
. " WHERE login_followers_follower = ? "
. " AND login_followers_following = ? ");
$stmt->bindParam(1, $follower);
$stmt->bindParam(2, $following);
$stmt->execute();
$row = $stmt->fetch();
$status = $row['login_followers_status'];
$num_of_rows = $stmt->fetchColumn();
echo $num_of_rows;