MySQL Forums :: PHP :: Querying Database to draw a Graph using PHPlot
Querying Database to draw a Graph using PHPlot
Date: December 10, 2012 12:23AM
Hi i am new in php and help will be appreciated as i have encountered a certain problem.
There is a error related to the query and the script will not run. I have no idea what the error is though.
//Include the code
//Define the object
$plot = new PHPlot(800,600);
//Define some data
$dbhost = "localhost";
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM try2";
$r = mysql_query($query);
if (!$r) exit();
$data = mysql_fetch_array();
$n_rows = mysql_fetch_row($r);
for ($i = 0; $i < $n_rows; $i++) $data = mysql_fetch_row($r, $i);
//Turn off X axis ticks and labels because they get in the way:
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.