Glaanieboy
OSNN Veteran Addict
- Joined
- 6 Mar 2002
- Messages
- 2,628
I am a total n00b when it comes to PHP functions, therefore I ask you to help me. I have come as far as this:
But that doesn't work, I get no value for $pizza_data. What magical trick should I apply to make this work? The queries are OK and when I use the function code as seperate code, it also works.
Code:
function pizza_data($pizzaid){
$search_pizza = mysql_query("SELECT * FROM pizza WHERE pizzaid=$pizzaid");
$fetch_pizza = mysql_fetch_array($search_pizza);
$pizza_data = $fetch_pizza['pizza'];
return $pizza_data;
}
...
(somewhere in here, $pizzaid gets a valid value)
...
pizza_data($pizzaid);
print $pizza_data;
But that doesn't work, I get no value for $pizza_data. What magical trick should I apply to make this work? The queries are OK and when I use the function code as seperate code, it also works.