0
基本上我不確定如何獲取查詢以便能夠計算行數。如何返回查詢以計算行數,以及如何計算行數?
我需要獲取檢查器的行數。下面
代碼:
$query = $handler->prepare("SELECT * FROM Admins WHERE ID= :userID OR Username= :userName OR Password= :encPass");
$query->bindParam(':userID', $userID);
$query->bindParam(':userName', $userName);
$query->bindParam(':encPass', $encrypted_password);
$query->execute();
一些如何在這裏的方式,讓我算的行數取
if (number of rows from query is >=1){
所以我會做$ count = $ query-> rowCount()然後在if語句中放入$ count> = 1? – Austin
@奧斯汀基本上,是的!你也可以簡單地使用:'if($ query-> rowCount()> = 1)' – hjpotter92
所以這就是我所做的,https://gyazo.com/de46beac3d0e98ecd7b57714e33feb7f ...每當我到達else語句時,該頁面只是空白。 – Austin