Gazz1982 Posted July 21, 2007 Share Posted July 21, 2007 Ok, I have created an updating graph by using the following code (after connecting to the db) but i cant seem to select from more than 1 column, any help? $sql = "SELECT def, count(*) AS def1 FROM answer GROUP BY def"; $result = mysql_query($sql); $data = array(); while (list($def, $def1) = mysql_fetch_row($result)) { $data[$def] = $def1; } include("phpgraphlib.php"); $graph=new PHPGraphLib(400,300); //$data=array("1"=>$def1, "2"=>198, "3"=>70, "4"=>90); $graph->addData($data); $graph->setTitle("Definitions"); $graph->setGridColor("153,204,255"); $graph->setGradient("red", "maroon"); $graph->setBarOutlineColor("black"); $graph->setTextColor("blue"); $graph->createGraph(); // Closing connection mysql_close($link); ?> Link to comment https://forums.phpfreaks.com/topic/61052-selecting-multiple-columns/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.