Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question$sql = "SELECT * FROM `stock` WHERE Item LIKE '%". $recherche ."%'" ;
$sql = 'SELECT * FROM stock WHERE Item LIKE \'%'. $recherche .'%\' ' ;
if(!empty($temp) && $temp != '' ) {
Votre recherche : <form method="post" action="stock.php" name="recherche"> </form> <?php $serveur = mysql_connect("127.0.0.1","root","****"); mysql_select_db('societe', $serveur); $recherche = 'LG'; if(!empty($temp) && $temp != '' ) { $recherche = $temp; $recherche = strip_tags($recherche); var_dump($recherche); } else { echo(''); var_dump($_POST['texte']); var_dump($recherche); } // Zone de test ; $sql = 'SELECT * FROM stock WHERE Item LIKE \'%'. $recherche .'%\' ' ; $resultat = mysql_query($sql) or die(' Req :' .$sql .''. mysql_error()); // On affiche tes variables var_dump($recherche); echo " "; var_dump($sql); echo " "; var_dump($resultat); echo " "; echo " <center>"; echo "\"; while ($data = mysql_fetch_array($resultat)) { echo\"---- "; echo $data['Item']; echo $data['Description']; echo $data['Quantity']; echo $data['Price']; echo $data['Currency']; echo ", \"; } { echo " </center> "; } ?>
$recherche = 'LG'; $temp = $_POST['search']; if(!empty($temp) && $temp != '' ) { $recherche = $temp;
Votre recherche : <form method="post" action="stock.php" name="recherche"> </form> <?php $serveur = mysql_connect("127.0.0.1","root","****"); if(!$serveur) { echo('Connexion refusée.'); } else if(!mysql_select_db('societe', $serveur)) { echo('Base non trouvée.'); } else { $recherche = 'LG'; a utiliser juste pour tes tests. $temp = $_POST['search'] if(!empty($temp) && $temp != '' ) { $recherche = $temp; $recherche = strip_tags($recherche); search_for($recherche); } else { echo('merci de saisir un article à rechercher'); } } function search_for($recherche) { $sql = 'SELECT * FROM stock WHERE Item LIKE \'%'. $recherche .'%\' ' ; $resultat = mysql_query($sql) or die(' Req :' .$sql .''. mysql_error()); echo " <center>"; echo "\"; while ($data = mysql_fetch_array($resultat)) { echo\"---- "; echo $data['Item']; echo $data['Description']; echo $data['Quantity']; echo $data['Price']; echo $data['Currency']; echo ", \"; } { echo " </center> "; } } ?>