Hi all!
Just a simple and (maybe) silly question.
I have a table with 2 fields: abb and pop. I make a query on that table to retrieve those two fields and populate a table. Here is the code:
$result = sql_query("SELECT abb, pop FROM ".$prefix."_test",$dbi);
$i=0;
while(list($abb,$pop)=sql_fetch_row($result,$dbi)){
$tab[$abb]=$pop;
}
Now i want to use $tab outside the while loop ( to generate a graph with Jpgraph)
How can i do that?
I tried to put a "return $tab" just before the closing }, but this didn't help...
thanks for helping :wink
retrieving array from mysql query
Moderator: General Moderators
-
keymistress
- Forum Newbie
- Posts: 3
- Joined: Wed Dec 25, 2002 10:03 pm
- Location: singapore