时间:2021-07-01 10:21:17 帮助过:7人阅读
//数据库查询相关 function sqlUserInfo($username, $password) { $users = trim($username); $pass = trim($password); $conn=mysql_connect($host,$users,$passwords); mysql_select_db($database,$conn); //echo "start connect db"; if(!$db) return false; //echo "start query db"; $query = "SELECT * FROM tb_users WHERE username = '".$users."' AND password = '".$pass."'"; $sql = mysql_query($query, $conn) or die(mysql_error()); if(mysql_num_rows($sql) == 1) return true; else die("数据库查询失败!"); return false; }