to be more clear .... :
$var = "value";
function func($var){
$sql=mysql_query("...$var...");
$res = mysql_result($sql);
//$var = $res;
}
echo("$value");
I want from the last line to display $res
value, Thanks.
by assigning $var="value" doesn't mean that is what is passed into the function. You have to call the function with any value you want and that value will be put into the $var variable within the func function.
What if you did:
$var = "value";
function func($var){
$sql=mysql_query("...$var...");
$res = mysql_result($sql);
return $res;
}
$ssn = func($var);
# you could also do func("value");
echo("$ssn");