J'ai un probleme avec cette requete $sql=mysql_query("SELECT id_techno FROM techno WHERE Nom_techno='$techno'");. J'arrive à recuperer la variable $techno (voir debut du code) mais je n'arrive pas à l'inserer dans une requete mysql.
Voici le code
<?
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Récupération des données provenant d'un formulaire base</title>
</head>
<body>
<form method="post" action="gamme.php" enctype="multipart/form-data">
<?
$segment = $_POST['Nom_segment'] ;
$techno = $_POST['Nom_techno'] ;
$_SESSION['Nom_techno'] = $_POST['Nom_techno'];
echo( "Segment <b>".$segment."</b><br>\n" ) ;
echo( "techno: <b>".$techno."</b><br>\n" ) ;
echo "Our color value is ".$_SESSION['Nom_techno']."<br>";
header ('location : gamme.php');
// Connexion à la base de données
include 'connexion.php';
$connexion =mysql_connect($host,$user,$password) or die ("connexion au serveur impossible");
mysql_select_db("engi_segment") or die("echec select db".mysql_error());
// Choix du type de la matiere
echo "<div style='margin-leflt: .5in;margin-top: .5in'>
<p><b>Quel type de matiere?</b>
<p>Choissisez dans la liste ci-dessous :\n";
$rs3=mysql_query("select Nom_matiere from matiere");
$idr = isset($_POST['Nom_matiere'])?$_POST['Nom_matiere']:null;
echo('<select id="Nom_matiere" name="Nom_matiere"="" >');
echo('<option value="'.'">'.'</option>');
while ($matiere=mysql_fetch_object($rs3)){
echo('<option value="'.$matiere->Nom_matiere .'">'.$matiere->Nom_matiere.'</option>' );
}
echo mysql_result($matiere); // Affiche le resultat
echo "<p><input type='submit' value ='validez votre choix'></form>\n";
// Choix du type du module
$sql=mysql_query("SELECT id_techno FROM techno WHERE Nom_techno='$techno'");
echo ("id2".$sql."</b><br>\n");
echo "<div style='margin-leflt: .5in;margin-top: .5in'>
<p><b>Quel type de matiere?</b>
<p>Choissisez dans la liste ci-dessous :\n";
$rs4=mysql_query("select Nom_design from design");
$idr = isset($_POST['Nom_design'])?$_POST['Nom_design']:null;
echo('<select id="Nom_design" name="Nom_design"="" >');
echo('<option value="'.'">'.'</option>');
while ($design=mysql_fetch_object($rs4)){
echo('<option value="'.$design->Nom_design .'">'.$design->Nom_design.'</option>' );
}
echo mysql_result($design); // Affiche le resultat
echo "<p><input type='submit' value ='validez votre choix'></form>\n";
mysql_close;
?>
</p>
</body>
</html>
Merci pour l'aide