Witam
Wykorzystywałem mysql4 jako bazę do wykreślania wykresów w jpgraph. Po upgradzie do mysql5
jpgraph twierdzi że brak mu danych do wykresu. Skrypt wykorzystywany jest na dwóch serwerach: apache+php4 i apache2+php5 a dane pobierane z upgradowanego mysql5.
Co jest nie tak (IMG:
http://forum.php.pl/style_emoticons/default/sad.gif) , przecież to proste połączenie.
<?php
$db = mysql_connect ("10.10.10.2", "klima", "@#$@t@#") or
die ("Nie ma polaczenia z mysql");
include ("graf/jpgraph.php");
include ("graf/jpgraph_line.php");
include ("graf/jpgraph_bar.php");
include('graf/jpgraph_pie.php');
include('graf/jpgraph_date.php');
("SELECT * FROM Pa WHERE dataczas between '.$T1.' and '.$T2.'") or
die(mysql_error());
$ydata[] = $row['P1'];
$leg[] = $row['dataczas'];
}
/// Create the graph and specify the scale for both Y-axis
$graph = new Graph(800,480,"auto");
$graph->SetScale('datlin');
$graph->ygrid->Show(true,false);
$graph->xgrid->Show(true,false);
$graph->SetShadow();
// Adjust the margin
$graph->img->SetMargin(70,40,30,95);
$graph->AdjBackgroundImage(0,0);
$graph->img->SetAntiAliasing("white");
// Create the two linear plot
$lineplot=new LinePlot($ydata);
// Add the plot to the graph
$graph->Add($lineplot);
// Adjust the axis color
//$graph->yaxis->SetColor("#0CC679");
$graph->title->Set("Dane za okres: od $T1 do $T2 (3dni)");
//$graph->xaxis->title->Set("X-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
//X
$graph->xaxis->SetTickLabels($leg);
//$graph->xaxis->title->Set("okres");
$graph->xaxis->SetLabelAngle(50);
$graph->xaxis->SetFont(FF_ARIAL, FS_NORMAL, 8);
// Set the colors for the plots
$lineplot->SetColor("#0CC660");
$lineplot->SetWeight(2);
// Set the legends for the plots
$lineplot->SetLegend("Cisnienie atmosferyczne [hPa]");
// Adjust the legend position
$graph->legend->Pos(0.02,0.08,"left","center");
// Display the graph
$graph->Stroke();
?>