嘿为什么我的函数在这里不起作用是php代码,它写在mysql_connect中:
function isUserLoggedIn() {
global $conn;
$sql = "SELECT user_id, password FROM user
WHERE
user_id='" . fixstr($loggedInUser->user_id) . "'
AND
password='" . fixstr($loggedInUser->password) . "'
AND
active = 1
LIMIT 1";
$res = mysql_query($sql);
$rs = mysql_fetch_array($res);
if($loggedInUser($res) == NULL)
{
return false;
}
else
{
//Query the database to ensure they haven't been removed or possibly banned?
if(returns_result($sql) > 0)
{
return true;
}
else
{
//No result returned kill the user session, user banned or deleted
$loggedInUser->userLogOut();
return false;
}
}
}
该连接确实返回了一个活动窗口,但无法连接到任何功能有人知道我的代码为什么不起作用吗?