Lets suppose following Database table:
id (primary key)
name
address
number
Now lets say i make following function:
function get_member($var1, $var2, $table) {
// where var1 and var2 are info needed to pull from DB
$query = mysql_query("SELECT * FROM $table WHERE id='$var1' AND search='$var2'")
or die("Mysql error:".mysql_error());
$queried = mysql_fetch_array($query);
$name = $queried['1'];
$address = $queried['2'];
return $name;
return $address;
}
Now i have tried setting name and address to global.. ofc var1 and var2 + table would be global, however, then i do this:
get_member('2', '300', 'member_table');
// now, i do for exampled want to display the name...
echo $name;
// however, no matter what i do, this will not work... echoing out the name in the function works fine.
I'm sure it's something simple he he... i tried to look about on here, but didn't find anything useful.
Thanks in advance