Problème base de données
" ; $sql="SELECT * FROM CARACT_PROFILS"; $result=@mysql_query($sql, $dbh); if($result == FALSE) {echo "problème";} else { $qte=mysql_num_rows($result); } if ($ID_Profil != '') { $sql1="SELECT * FROM CARACT_PROFILS WHERE ORDRE='$ID_Profil'"; $selection=$ID_Profil; } else { $sql1="SELECT * FROM CARACT_PROFILS WHERE ORDRE=1"; $selection=1; } $Ref=$selection; $result1=@mysql_query($sql1, $dbh); if($result1 == FALSE) {echo "problème";} $sql2="SELECT * FROM PROFILS WHERE NUM='$selection'"; $result2=@mysql_query($sql2, $dbh); if($result2 == FALSE) {echo "problème";} $sql_graph=@mysql_query($sql2, $dbh); $row = mysql_fetch_array($sql_graph); $Nom_Profil =""; $Nom_Profil = $row[1]; //echo $Nom_Profil; while($row = mysql_fetch_array($sql_graph)) { $datax[] = $row[2]; $datay[] = $row[3]; //echo $row[2];echo "xxx>";echo $row[3];echo "
"; } $graph = new graph(1000, 200); $graph->img->SetMargin(2,10,40,40); $graph->img->SetAntiAliasing(); $graph->SetScale("linlin"); $graph->SetShadow(); $graph->title->Set($Nom_Profil); $graph->title->SetFont(FF_FONT1,FS_BOLD); $sp1 = new ScatterPlot($datay,$datax); $sp1->SetLinkPoints(true,"blue",2); $sp1->mark->SetType(MARK_FILLEDCIRCLE); $sp1->mark->SetFillColor("red"); $sp1->mark->SetWidth(0.1); $graph->Add($sp1); $graph->Stroke("Draw_Profil.png"); ?>
PROFILS
include ("menu_haut.php") ?>
include ("GAUCHE.php") ?>
Les Profils
while ($row=mysql_fetch_array($result,MYSQL_NUM)) { echo "
".$row[0]."
"; } ?>
for ($i=0;$i<6;$i++) {echo"
". mysql_field_name($result,$i)."
";} echo"
"; while ($row=mysql_fetch_array($result1,MYSQL_ASSOC)) { $cpt=0; foreach ($row as $elem) { if ($cpt < 6) {echo "
$elem
";} $cpt++; } echo"
"; } ?>
Copiez/collez les X et Y dans
PROFILS.XLS
pour obtenir le tracé du profil.
cliquez sur le profil pourl'agrandir
X
Y
echo "
"; $cpt=0; while ($row=mysql_fetch_array($result2,MYSQL_ASSOC)) { foreach ($row as $elem) { if ($cpt > 1) {echo "
$elem
"; } $cpt++; } echo"
"; $cpt=0; } ?>
include ("Bas_Page.php") ?>