</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr><td height="31" align="right" ><input type="submit" value="" class="btnsearch"></td></tr>
</tbody>
</table>
</table>
<input type="hidden" name="action" value="1">
</form>
</div>
<!--fin recherche avance-->
et voila le code php ma page resultat.php
//resultat recherche avancee
if(isset($_POST['action']) && $_POST['action'] == 1){
//tout null ok
if($_POST["type"] == 0 && $_POST["prix"] == 0 && $_POST["ville"] == 0){
$search1="select * from articles where publie='Oui'";
$resultatsearch1=mysql_query($search1);
$donneessearch1=mysql_fetch_assoc($resultatsearch1);
}
//prix no null ville null prix null
elseif($_POST["prix"] !== 0 && $_POST["ville"] == 0 && $_POST["type"] == 0){
$search1="select * from articles where prix='".$_POST["prix"]."' and publie='Oui' order by date desc";
$resultatsearch1=mysql_query($search1);
$donneessearch1=mysql_fetch_assoc($resultatsearch1);
}
//type no null ville null type null ok
elseif($_POST["type"] !== 0 && $_POST["prix"] == 0 && $_POST["ville"] == 0){
$search1="select * from articles where type='".$_POST["type"]."' and publie='Oui' order by date desc";
$resultatsearch1=mysql_query($search1);
$donneessearch1=mysql_fetch_assoc($resultatsearch1);
}
//ville no null type null prix null
elseif($_POST["ville"] !== 0 && $_POST["prix"] == 0 && $_POST["type"] == 0){
$search1="select * from articles where ville='".$_POST["ville"]."' and publie='Oui' order by date desc";
$resultatsearch1=mysql_query($search1);
$donneessearch1=mysql_fetch_assoc($resultatsearch1);
}
//prix+ville no null type null
elseif($_POST["ville"] !== 0 && $_POST["prix"] !== 0 && $_POST["type"] == 0){
$search1="select * from articles where ville='".$_POST["ville"]."' and prix='".$_POST["prix"]."' and publie='Oui' order by date desc";
$resultatsearch1=mysql_query($search1);
$donneessearch1=mysql_fetch_assoc($resultatsearch1);
}
//prix type not null ville null
elseif($_POST["ville"] == 0 && $_POST["prix"] !== 0 && $_POST["type"] !== 0){
$search1="select * from articles where prix='".$_POST["prix"]."' and type='".$_POST["type"]."' and publie='Oui' order by date desc";
$resultatsearch1=mysql_query($search1);
$donneessearch1=mysql_fetch_assoc($resultatsearch1);
}
//ville type no null prix null
elseif($_POST["ville"] !== 0 && $_POST["prix"] == 0 && $_POST["type"] !== 0){
$search1="select * from articles where ville='".$_POST["ville"]."' and type='".$_POST["type"]."' and publie='Oui' order by date desc";
$resultatsearch1=mysql_query($search1);
$donneessearch1=mysql_fetch_assoc($resultatsearch1);
}
}