rashmi_k28 Posted October 13, 2008 Share Posted October 13, 2008 Hi, Based on the value passed from the check box, I have to plot a graph querying the database. Suppose if I check 2 boxes, two values are passed and I have to plot the linegraph for 2 parameters in the single graph i.e the accumulated graph. How to querying Sql statements I know but I have no idea how to store the values and separate it into two different arrays. function getValues() { $value=arrays(); if($option==1){ $sql="select bd from table1"; } if($option==2){ $sql="select bw from table2"; } return $value; } How to store the data in $value and separate it for plotting two arrays. Link to comment https://forums.phpfreaks.com/topic/128163-array/ Share on other sites More sharing options...
Andy-H Posted October 13, 2008 Share Posted October 13, 2008 Hi, Based on the value passed from the check box, I have to plot a graph querying the database. Suppose if I check 2 boxes, two values are passed and I have to plot the linegraph for 2 parameters in the single graph i.e the accumulated graph. How to querying Sql statements I know but I have no idea how to store the values and separate it into two different arrays. function getValues($option = 1) { $value=array(); if($option==1){ $value[] = "select bd from table1"; } if($option==2){ $value[] = "select bw from table2"; } return $value; } How to store the data in $value and separate it for plotting two arrays. Link to comment https://forums.phpfreaks.com/topic/128163-array/#findComment-663795 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.