voici mes codes
et il me reste le moteur de recherche et la page de résultat
<style type="text/css">
<!--
.Style1 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FF6600;
}
.Style2 {
font-size: 10px;
font-family: Geneva, Arial, Helvetica, sans-serif;
}
.Style3 {color: #0000FF}
.Style4 {color: #FF0000}
-->
</style>
<table width="727" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="46" colspan="6" valign="top"><p align="center"><span class="Style1">Liste des entreprises de </span> <BR>
<span class="Style2">entrer le nom de la société ou tapez le produits pour faire des recherche</span></p></td>
<td width="13"> </td>
</tr>
<tr>
<td height="33" colspan="6" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="714" height="33" valign="top"><form method="post" action="recherche.php">
<label>
<div align="center">
<input type="text" name="textfield">
<input type="submit" name="Submit" value="Recherche">
</div>
</label>
<label></label>
</form> </td>
</tr>
</table></td>
<td> </td>
</tr>
<tr>
<td height="19" colspan="6" valign="top"><!--DWLayoutEmptyCell--> </td>
<td></td>
</tr>
<tr>
<td width="20" height="197"> </td>
<td width="207" valign="top"> cette zone sera la zone de recherche quand on tape " le nom ou produits"<br><?php
mysql_connect("localhost", "root", ""); // Connexion à MySQL
mysql_select_db("annuaire"); // Sélection de la base mateo21
$reponse = mysql_query("SELECT * FROM annuaire") or die(mysql_error()); // Requête SQL
// On fait une boucle pour lister tout ce que contient la table :
while ($donnees = mysql_fetch_array($reponse) )
{
?>
<p>
<strong>Société : </strong><?php echo $donnees['nom']; ?><br />
<strong>Responsable :</strong> <?php echo $donnees['responsable']; ?>, <br>
<strong>Catégorie: </strong><?php echo $donnees['categorie']; ?> <br>
<strong>Produits:</strong> <?php echo $donnees['produits']; ?> <br>
<em><strong>Adresse:</strong> <?php echo $donnees['adresse']; ?></em> <br>
<strong>Localisatiion: </strong><?php echo $donnees['emplacement']; ?> </p>
<?php
}
mysql_close(); // Déconnexion de MySQL
?></td>
<td width="29"> </td>
<td width="210" valign="top">Je souhaite que la catégorie seul s'affiche et comment faire pour que les catégorie s'aligne e nbas comme <br>
<strong>INFORMATIQUE </strong><BR>
Cafe informatique<br>
togo telecom</span> ,<br>
<span class="Style4">ainsi de suite mais qu'il soit des leins </span><br><br>
<?php
mysql_connect("localhost", "root", ""); // Connexion à MySQL
mysql_select_db("annuaire");
$reponse = mysql_query("SELECT categorie FROM annuaire")or die(mysql_error()); // Requête SQL
// Avec cette boucle, on liste uniquement le nom des catégorie:
while ($donnees = mysql_fetch_array($reponse) )
{
echo $donnees['categorie'];
echo "<br />";
}
mysql_close(); // Déconnexion de MySQL
?></td>
<td width="25"> </td>
<td width="223" valign="top"><a href="nouvelles2009.php?id=<?php echo $id2; ?></td>
<td> </td>
</tr>
<tr>
<td height="505">
</tr>
</table>
et la base de donner
-- phpMyAdmin SQL Dump
-- version 2.6.1
--
http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Mercredi 10 Février 2010 à 14:17
-- Version du serveur: 4.1.9
-- Version de PHP: 4.3.10
--
-- Base de données: `annuaire`
--
-- --------------------------------------------------------
--
-- Structure de la table `annuaire`
--
CREATE TABLE `annuaire` (
`id` int(11) NOT NULL auto_increment,
`nom` varchar(55) NOT NULL default '',
`responsable` varchar(55) NOT NULL default '',
`categorie` varchar(50) NOT NULL default '',
`produits` varchar(50) NOT NULL default '',
`adresse` varchar(255) NOT NULL default '',
`emplacement` varchar(50) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Contenu de la table `annuaire`
--
INSERT INTO `annuaire` VALUES (1, 'chezkyp', 'Madame ckez kyp', 'vetements', 'habits enfants ,habits ,maman, chemises; patalon', '12 rue lome', 'Pavillon OTI');
INSERT INTO `annuaire` VALUES (2, 'give and take', 'Mr give and take', 'électroménager', 'climatiseurs, frigos,tv', '15 tokoin', 'pavillom Mono');
INSERT INTO `annuaire` VALUES (3, 'CAFE INFORMATIQUE', 'NAOGBODJI', 'informatiaque', 'logiciel, solutions ,dévéloppement', '15 rue togo', 'Pavillon OTI');
INSERT INTO `annuaire` VALUES (4, 'logon 228', 'Lella', 'Bar resataurent', 'bièrres, poulets', '25 rue lomé', 'shopping');
INSERT INTO `annuaire` VALUES (5, 'REMARK', 'PETER', 'vetements', 'jeans , cheminses , t-shirt', '15 grand marché', 'Pavillon mon');
INSERT INTO `annuaire` VALUES (6, 'BTIC', '', 'BANQUE', 'échange', '13 JANVIER', 'pavillon OTI');