EN CHOISISSNT UNE LE SELECT WILAYA, le select commune ce chargera
je cherche le pb dans mon script
<? require_once('Connections/conect.php');
mysql_select_db($database_conect, $conect);
$query_Rec_wil = "SELECT wilaya FROM wilayas ORDER BY wilaya ASC";
$Rec_wil = mysql_query($query_Rec_wil, $conect) or die(mysql_error());
$row_Rec_wil = mysql_fetch_assoc($Rec_wil);
$totalRows_Rec_wil = mysql_num_rows($Rec_wil);
?>
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php
function choix($ch)
{
echo 'jjjj';
mysql_select_db($database_conect, $conect);
$query_Rec_com = "SELECT * FROM communes WHERE wilaya='$ch' ORDER BY COMMUNE ASC";
$Rec_com = mysql_query($query_Rec_com, $conect) or die(mysql_error());
$row_Rec_com = mysql_fetch_assoc($Rec_com);
$totalRows_Rec_com = mysql_num_rows($Rec_com);
}
?>
</head>
<body>
<form name="form1" method="post" action="">
<p> </p>
<table width="27%">
<tr>
<td><select name="wil" id="wil" onChange="<?Php echo choix(?> this.value <? ) ;?>" STYLE="color:#004080; background:#C7D8F8; font-size : 8pt">
<?php
do {
$wilaya=$row_Rec_wil['wilaya'];
?>
<option value="<?php echo $wilaya; ?>"<?php if (!(strcmp($wilaya, $wilaya))) {echo "SELECTED";} ?>><font size="2"><?php echo $wilaya; ?></font></option>
<?php
} while ($row_Rec_wil = mysql_fetch_assoc($Rec_wil));
$rows = mysql_num_rows($Rec_wil);
if($rows > 0) {
mysql_data_seek($Rec_wil, 0);
$Rec_wil = mysql_fetch_assoc($Rec_wil);
}
?>
</select></td>
</tr>
<tr>
<td><select name="com" id="com" onChange="javascript:document.location.href=(this.value);" STYLE="color:#004080; background:#C7D8F8; font-size : 8pt">
<?php
do {
if ($row_Rec_com['COMMUNE']=="Sidi M'hamed")
{
$commune="Sidi M''hamed";
}
else
{
$commune=$row_Rec_com['COMMUNE'];
}
?>
<option value="<?php echo $commune; ?>"<?php if (!(strcmp($commune, $commune))) {echo "SELECTED";} ?>><font size="2"><?php echo $commune; ?></font></option>
<?php
} while ($row_Rec_com = mysql_fetch_assoc($Rec_com));
$rows = mysql_num_rows($Rec_com);
if($rows > 0) {
mysql_data_seek($Rec_com, 0);
$Rec_com = mysql_fetch_assoc($Rec_com);
}
?>
</select></td>
</tr>
</table>
<p> </p>
</form>
</body>
</html>