<?php
$link=mysql_connect("localhost", "root","parola") or die("Could not connect: " . mysql_error());
print ("Connected successfully");print "</br>";
mysql_select_db('energiesolara',$link) or die ('Can\'t use energiesolaradb: ' . mysql_error());
$x=mysql_query("SELECT umiditate FROM parametrii");
$y=mysql_query("SELECT temperatura FROM parametrii");
$info1 = mysql_fetch_array($x);
$info2 = mysql_fetch_array($y);
$xi=array($info1['umiditate']);
$yi=array($info2['temperatura']);
include('phpgraphlib.php');
$graph=new PHPGraphLib(500,280);
$graph->addData($xi,$yi);
$graph->setTitle('Grafic');
$graph->setTitleLocation('left');
$graph->setLegend(true);
$graph->setLegendTitle('Module-1', 'Module-2');
$graph->setGradient('green', 'olive');
$graph->createGraph();
?>
I have this error :(
Connected successfully
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\xampp\htdocs\charty.php:3) in C:\xampp\xampp\htdocs\phpgraphlib.php on line 163
‰PNG IHDRôŽôA¿PLTEÿÿÿÜÜÜÈÈÈdddYYYYYYYY YYYYYYYYYYYYYYYYYY!Y