klinmy Posted April 23, 2009 Share Posted April 23, 2009 Hi, i would need this type of array data e.g. $new=array(12,23,9,2) to be used to plot the graph (axis-y), $plot = new BarPlot($new); however, if the array data is retrieved from the database, how can i map the retrieved data (eg: temperature = 21, 20, 19, 15) into $new = array (21,20,19,15)? while ($row = mysql_fetch_assoc($result)) { $temp = $row["Temperature"]; } it retrieved the data as (21201915), what should i do to map this into $new=array (21,20,19,15). thanks in advance. Link to comment https://forums.phpfreaks.com/topic/155374-array/ Share on other sites More sharing options...
premiso Posted April 23, 2009 Share Posted April 23, 2009 $temp[] = $row["Temperature"]; Should do it. Link to comment https://forums.phpfreaks.com/topic/155374-array/#findComment-817475 Share on other sites More sharing options...
klinmy Posted April 23, 2009 Author Share Posted April 23, 2009 wow thanks ALOT premiso! seriously, i've been trying to figure it out for the whole freaking day. thanks for helping! Link to comment https://forums.phpfreaks.com/topic/155374-array/#findComment-817487 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.