bonjour,

voilà j'ai une requete multicritères qui marche très bien, ce que je voudrais c'est que ca m'affiche un message avec un alert en javascript ou meme du texte php mais qui indique que la recherche n'a retourné aucun enregistrement.

je ne sais pas comment et ou il faut mettre ce code

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
<?php
include( "config_server.php" );
$expl=explode(" ",$_POST['select_prix']);
 
$sql = "SELECT * FROM biens WHERE statut='A VENDRE' AND type='" . $_POST['select_type'] . "' AND SITUATION='" . $_POST['champcommune'] . "' AND prix BETWEEN $expl[0] AND $expl[1] "; 
 
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
?>
 
    <table width="473"  class="tableau-affichage">
    <?php
    while ($data = mysql_fetch_array($req)) {
	?>
	<tr>
    <td><!-- td1 -->
	<table width="466" bgcolor="#E3F9D2" style="border:1px solid #8E8A8A; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold; ">
 
    <tr>
    <td>Situation : <?php echo $data['situation']; ?></td>
    <td align="center">Prix : <?php echo $data['prix']; ?> euros</td>
    </tr>
    </table>
    </td><!-- fin td1 -->
    </tr>
    <tr>
    <td><!-- td2 -->
	<table width="466" bgcolor="#FFFFCC" style="border:1px solid #8E8A8A;">
    <tr>
     <td><a href="details_biens.php?id=<?php echo $data['id'] ?>"><?php echo '<img src="'.$data['photo1'].'" width="132" height="100" style="border:1px solid #000000; " />' ?></a></td>
    <td><?php echo $data['composition']; ?></td>
    </tr>
    </table>
 
	</td><!-- fin td2 -->
    </tr>
<?php
    }
    ?>
	</table>
merci pour votre aide