日期:2014-05-17 浏览次数:20488 次
//数据库查询相关 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; }