我希望這段代碼檢查表單登錄是否$name在$password數(shù)據(jù)庫(kù)中,如果是,則顯示,echo "Hello ".$name;如果不是echo "You are not in database";,但問(wèn)題是它總是顯示真相。感謝您的回答,抱歉我的英語(yǔ)) include "db.php"; $db = db(); /*print_r($db);*/ $name = $_POST["name"]; $password = $_POST["password"]; $qur = "SELECT * FROM login WHERE name ='".$name."' AND password = '".$password."'"; $data_from_table = $db->query($qur); if($data_from_table == true) { echo "Hello ".$name; } else { echo "You are not in database"; }
我的 php 代碼不檢查數(shù)據(jù)庫(kù)數(shù)據(jù)
慕尼黑的夜晚無(wú)繁華
2023-08-19 17:51:01