Hello,
I'm trying to return mysql values via function.
basically I have these two:
function create_project() {
load_user();
echo "Hello $uname ($email)";
exit;
}
function load_user() {
$id=$_SESSION['uid'];
$sql = <<<EOF
SELECT uname,email from x_members_x where uid='$id'
EOF;
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$uname=$row[0];
$email=$row[1];
}
//I wanna return all the values of uname/email.
}
}
I tried using the "return" statement but no luck
any help?
-aaron
I'm trying to return mysql values via function.
basically I have these two:
function create_project() {
load_user();
echo "Hello $uname ($email)";
exit;
}
function load_user() {
$id=$_SESSION['uid'];
$sql = <<<EOF
SELECT uname,email from x_members_x where uid='$id'
EOF;
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$uname=$row[0];
$email=$row[1];
}
//I wanna return all the values of uname/email.
}
}
I tried using the "return" statement but no luck
any help?
-aaron