Requete pour la recherche

Résolu
bonjour
j'ai fais une application web en utilisant easyphp1.8 et dreamweaver 8
je veux faire une page pour la recherche dans la base de données voici ce que jai fais
<?
$nlatin=$_POST["nlatin"];
$platin=$_POST["platin"];
$DATEN=$_POST["DATEN"];
$codn=$_POST["CODN"];

require ("connexion.php");
$id_examen = mysql_query("SELECT 'nlatin', 'platin', 'daten','codn' from fichier
where 'nlatin'='$nlatin' and 'platin'='$platin' and 'daten'='$daten' and 'codn'='$codn'");
$result = mysql_fetch_array($id_examen);
$id = $result[0];

?>
<!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>Document sans titre</title>
<style type="text/css">
<!--
.Style27 {color: #696C70; font-size: medium; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; }
.Style2 {font-size: medium; font-family: Verdana, Arial, Helvetica, sans-serif; }
.Style4 {color: #990000}
-->
</style>
</head>

<body>
<table width="659">
<tr>
<td width="800" height="40"><p align="center" class="Style27">- Résultat de la recherche -</p></td>
</tr>
</table>
<table width="828" border="0" cellpadding="0" cellspacing="2">
<tr class="Style2">

<td width="103" class="Style16 Style4">NOM</td>
<td width="171" class="Style16 Style4"><div align="center">PRENOM</div></td>
<td width="239" class="Style16 Style4"><div align="center">DATE NAISSANCE</div></td>
<td width="214" class="Style16 Style4"><div align="center">CODE NATIONAL </div></td>
</tr>
<?php
require ("connexion.php");

$sql = mysql_query("SELECT 'nlatin', 'platin', 'DATEN','CODN' FROM fichier");
while($row=mysql_fetch_array($sql))
{
?>

<tr class="Style2">
<td class="Style5"><div align="center"><span class="Style18"><?php echo ucfirst($row['NLATIN']);?></span></td>
<td class="Style5"><div align="center"><span class="Style18"><?php echo ucfirst($row['PLATIN']);?></span></div></td>
<td class="Style5"><div align="center"><span class="Style18"><?php echo ucfirst($row['DATEN']);?></span></div></td>
<td class="Style5"><div align="center"><span class="Style18"><?php echo strtoupper($row['CODN']);?></span></div></td>
<td class="Style5"><div align="center"></div></td>
</tr>
<?php
} //fin while
?>
</table>
</body>
</html>
svp quelqun peut m'aider
merci et bon courage

2 réponses

  • Votes
  • Date
  • Date décroissante
  1. voici l'erreur qui m'affiche à l'execution
    Notice: Undefined index: PLATIN in c:\program files (x86)\easyphp1-8\www\laam\recherche.php on line 52i
    1. Salut,

      Dans la dernière boucle, $row['NLATIN'] n'existe pas, c'est plutôt $row['nlatin'].
      Même chose pour les autres.
      1. bonjour
        merci beaucoup maintenant il maffiche aucune erreur mais jai remarqué quil fait aucune recherche càd jai une autre page espace client pour permettre la recherche par nom en cliquant sur rechercher il me donne la page que jai donne dessus mais il maffiche toute l table mais je veux avoir seulement la recherche par nom ou prenom ou date de naissance
        merci et bon courage je crois que ma requeté n'ai pas fiable
        merci beaucoup