PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hi
How can I get the value of the $albnumber out of the function?
function test($act)
{
$alquery = mysql_query("SELECT * FROM active WHERE apro='Albe' AND ar LIKE '%$act%'");
$albnumber=mysql_num_rows($alquery);
echo $albnumber;
}
value of $act is coming from other page with $_get['somevalue'].
function is working fine but I am unable to use the value of $albnumber outside of the function. I tried "return" but unable to get the value. I have multiple variables inside the function and I want to use their values inside the script. Anyone can help ?
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
rest of the code is just displaying the variables value on the page. There are about 25 variables in all and I am getting all inside the function with $activity1=$_GET['activity1']; and so on...The value of activity1 is coming from other page. So I used the function as test($activity1); . How can I use multiple variable values outside the function? I tried return $albnumber; but its not working at all.
How can I print individual value from that array? like I have 15 elements in the array and I want the separate values of each and want to use that separate value in the other part of the script.
How can I print individual value from that array? like I have 15 elements in the array and I want the separate values of each and want to use that separate value in the other part of the script.