function get_user_id()
{
global $db;
$userid = NULL;
if (!empty($_COOKIE['PHPSESSID']))
{
$result = $db->execute("
SELECT profile_id
FROM " . TABLE_PREFIX . "profile_online
WHERE hash = '" . $db->escape_string($_COOKIE['PHPSESSID']) . "'
");
if ($row = $db->fetch_array($result))
{
$userid = $row[0];
}
}
return $userid;
}
function get_membership_id($userid)
{
global $db;
$result = $db->execute("
SELECT * FROM date_profile WHERE profile_id = '" . $db->escape_string($userid) . "'");
$mem = $db->fetch_array($result)
$membership = $mem[17];
return $membership;
}
运行良好...但是get_user_id
会员部分我无法正常工作..
我正在尝试获取会员 ID.. 并使其无法为他们运行某些代码。
with an : if ($membership != 18 )
所以它显示除了会员 18 人之外的所有人...
也试过这个:
function get_membership_id($userid)
{
global $db;
$membership = $db->execute("SELECT `membership_type_id` FROM `date_profile` WHERE `profile_id`= '" . $db->escape_string($userid) . "'");
return $membership;
}
任何帮助将不胜感激。