askin about function ..
Posted: Tue Sep 08, 2009 5:19 am
hi evry body
i have a big problem
i want to get a variable value from inside a function to out side
the variable is $array
i want to use it out side for example
or
pleaseeeeeee help me if u can
and i dont know if my post in the right section or not but i'm sorry
waiting for you
Happy day
i have a big problem
i want to get a variable value from inside a function to out side
Code: Select all
function work($name){
global $db_prefix;
$query = mysql_query("select * from `" .$db_prefix. "addons` where name ='" .$name . "'");
$array = mysql_fetch_array($query);
$array = $array['work'] ;
return $name ;
}
i want to use it out side for example
Code: Select all
function work($name){
global $db_prefix;
$query = mysql_query("select * from `" .$db_prefix. "addons` where name ='" .$name . "'");
$array = mysql_fetch_array($query);
$array = $array['work'] ;
return $name ;
}
echo $array ;or
Code: Select all
function work($name){
global $db_prefix;
$query = mysql_query("select * from `" .$db_prefix. "addons` where name ='" .$name . "'");
$array = mysql_fetch_array($query);
$array = $array['work'] ;
return $name ;
}
if ($array == 1){
echo "done";
}and i dont know if my post in the right section or not but i'm sorry
waiting for you
Happy day