Hi
I’m trying to write a function that will query a table and then store the values in a variable. if I use the below code on its own it works fine with no errors. nothing happens when I try and use the set variables on the page that I call the function.
calling the function
[code]
get_member_information(“first_name, last_name, email_address, phone_number, street_address, city, province, postal_code, last_login”);
here is the function this far
[code]
function get_member_information($get_data)
{
include (“db.php”);
$member_id = ‘0000000’/*$_SESSION[‘user_id’]*/;
$sql = (“SELECT $get_data FROM members WHERE user_id =’$member_id'”);
echo $sql;
$qry = mysql_query($sql)or die(“SQL Error: $sql<br>” . mysql_error());
$member_details = mysql_fetch_assoc($qry);
echo $first_name;
$first_name = $member_details[‘first_name’];
$last_name = $member_details[‘last_name’];
$email_address = $member_details[’email_address’];
$street_address = $member_details[‘street_address’];
$city = $member_details[‘city’];
$provice = $member_details[‘provice’];
$postal_code = $member_details[‘postal_code’];
$signup_date = $member_details[‘signup_date’];
$new_login = $member_details[‘new_login’];
$last_login = $member_details[‘last_login’];
$user_level = $member_details[‘user_level’];
$activated = $member_details[‘activated’];
$event_id = $member_details[‘event_id’];
}