23 lines
925 B
PHP
23 lines
925 B
PHP
<?php
|
|
$thost="localhost";
|
|
$tuser="root";
|
|
$tpass="M6BxrtFh";
|
|
$tdb="c0lematelot";
|
|
$idcon = mysql_connect($thost, $tuser, $tpass) or die("Pas de connexion au serveur".mysql_error ());
|
|
mysql_select_db($tdb) or die("Cette table n'existe pas");
|
|
|
|
$refprod = $_POST["prodref"];
|
|
$valueoption = $_POST["optionval"];
|
|
$sql=mysql_query("select* from combidecli where produit='".$refprod."' and ref LIKE '".$valueoption.",%' and stock > 0") or die("erreur");
|
|
echo "<label for=\"declinaison5\">Couleur:</label>";
|
|
echo "<select name=\"declinaison5\">";
|
|
echo "<option value=\"\"></option>";
|
|
while($row = mysql_fetch_array($sql)){
|
|
$recupref = preg_replace('#'.$valueoption.',#','',$row[2]);
|
|
$sqlref=mysql_query("select * from declidispdesc where declidisp='".$recupref."' and lang='1'");
|
|
$rowref=mysql_fetch_row($sqlref);
|
|
echo "<option value=\"".$rowref[1]."\">".utf8_encode($rowref[3])."</option>";
|
|
}
|
|
echo "</select>";
|
|
mysql_close($idcon);
|
|
?>
|