I have a php script that makes multiple sql query's that results
multiple datasets that I will use in a graph.
Its set up something like this.
for($i=0; $i<$n; $i++){
sql query runs here n times and produce each time a dataset that looks like.
2007-10-17 3
2007-10-18 4
2007-10-19 2
I want to put each dataset in an Array with diferent name.
I manage to put on dataset it in one array
$ydata[] = $row[1];
$xdata[] = $row[0];
}
but I need one array of every dataset with names that I can recognize
outside the loop, for eks a dynamic variabel name that consist of
$i and some other name.
like $i.$xdata[], but I cant make this work.
Anyone now how to do this I would be very grateful.
kritro
Dynamic variabel names in Arrays
Moderator: General Moderators
Code: Select all
${$i.$xdata}[]Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.