bonsoir tt le monde ,bon voila mon problème je vx utiliser le fichier xml à la place de la db mysql ,mais j'arrive pas a établir la connexion .
pr les requetes(xquery) c bon ,mais la connexion j'ai tjs des problèmes.
voila mon fichier.
<?php
include ("jpgraph/src/jpgraph.php");
include ("jpgraph/src/jpgraph_bar.php");
$db = mysql_connect("localhost", "omar","dhjwalja") or die(mysql_error());
mysql_select_db("moodle",$db) or die(mysql_error());
$sql = mysql_query("SELECT id,timezone FROM mdl_user") or die(mysql_error());
while($row = mysql_fetch_array($sql)) {
$data[] = $row[1];
$leg[] = $row[0];
}
$graph = new Graph(1050,450,"auto");
$graph->SetScale("textint");
$graph->img->SetMargin(50,30,50,50);
//$graph->AdjBackgroundImage(0.5,0.7,-1); //setting BG type
//$graph->SetBackgroundImage("linux_pez.png",BGIMG_FILLFRAME); //adding image
$graph->SetShadow();
$graph->title->Set("statistique d'un étudiant");
$graph->xaxis->title->Set("nom des étudiant");
$graph->yaxis->title->Set("notes des étudiant");
$graph->xaxis->SetTickLabels($leg);
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$bplot = new BarPlot($data);
$bplot->SetFillColor("lightgreen"); // Fill color
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD);
$bplot->value->SetAngle(45);
$bplot->value->SetColor("black","navy");
$graph->Add($bplot);
$graph->Stroke();
?>
merci d'avance.