Knoman
01-09-2002, 02:55 AM
heh, I'm stumped. I cant seen to get this function to work right.
function pullstats ($type) {
$result= mysql_query("SELECT * FROM user WHERE userid=1")
or die ("Query Failed");
$stat[$type]= (mysql_result($result,0,$type));
return $stat[$type];
}
pullstats ("username");
print $stat[$type];
if i were to pull it out of the function and define $type, it then works.
function pullstats ($type) {
$result= mysql_query("SELECT * FROM user WHERE userid=1")
or die ("Query Failed");
$stat[$type]= (mysql_result($result,0,$type));
return $stat[$type];
}
pullstats ("username");
print $stat[$type];
if i were to pull it out of the function and define $type, it then works.