php/SQL function not working? trying to get the membership_id from a database -
function get_user_id() { global $db; $userid = null; if (!empty($_cookie['phpsessid'])) { $result = $db->execute(" select profile_id " . table_prefix . "profile_online 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 * date_profile profile_id = '" . $db->escape_string($userid) . "'"); $mem = $db->fetch_array($result) $membership = $mem[17]; return $membership; } the get_user_id functioning fine... membership part can't work..
i trying take membership ids.. , make code not run them.
with : if ($membership != 18 ) shows except membership 18 people...
also tried this:
function get_membership_id($userid) { global $db; $membership = $db->execute("select `membership_type_id` `date_profile` `profile_id`= '" . $db->escape_string($userid) . "'"); return $membership; } any appreciated greatly.
missed ; here
$mem = $db->fetch_array($result); ^
Comments
Post a Comment