bonjour tout le monde je suis encore débutant sur php et mysql
mon problème est comme de suite
faire une requête mysql qui permet de faire une recherche sur plusieurs table j'ai essayer avec MATCH et ces toujours nul ci joint vous retrouver une le code page de recherche et code page de traitement merci d'avance
code page de recherche php
Code PHP :
<?php
include("header/header.php");
?>
<body>
<div id="main_container">
<div id="header">
<div class="logo"><img src="images/logo.gif" border="0" alt="" title="" /></div>
</div>
<div class="menu">
<ul>
<li><a href="Acceuil.php">Acceuil</a></li>
<li class="selected"><a href="Recherche.php">Recherche</a></li>
<li><a href="Rapport.php">Rapport</a></li>
<li><a href="Deconnexion.php">Deconnexion</a></li>
<li><a href="contact.php">contact</a></li>
<li> <?php echo $_SESSION['username'];?></li>
</ul>
</div>
<div class="center_content">
<form action="Recherche_art.php" method=post>
<div style="width:600px; margin:0 auto;"><br>
<TABLE width="100%">
<TD width="20%">
<TD width="20%">
<TD width="25%">Recherche:
<TD width="25%"> <input name="recherche" size="25" type="text" id="recherche" />
<script type="text/javascript">
var recherche = new LiveValidation('recherche');
recherche.add( Validate.Presence );
</script>
<TD width="10%"><input type=submit value='OK' name=submit class="ok">
</TABLE>
<br><br><br><br><br>
<TABLE width="100%">
<TD width="20%"><select name="type recherche" id="type recherche" >
<option value="null" >Tous</option>
<option value="art" >Article</option>
<option value="four" >Fourniseur</option>
<option value="bl" > B-L </option>
<option value="bc" > B-C </option>
<option value="marche" >Marché</option>
<option value="affec_nom" >Affectation</option>
</select>
<TD width="5%">DU
<TD width="20%"><input type="text" id="from" name="from" class="form_input_contact" />
<TD width="5%">AU
<TD width="20%"><input type="text" id="to" name="to" class="form_input_contact" />
</TABLE>
</form>
<?php
?>
</div>
<div class="clear"></div>
</div>
<div id="footer">
<div class="left_footer"></div>
<div class="right_footer">Copyright CNESTEN 2013 </div>
</div>
</div>
<!-- end of main_container -->
</body>
</html>
et voila le code mysql et pour info j'ai 5 table avec jointure et table user
Code PHP :
<?php
session_start();
$recherche=$_POST['recherche'];
$type recherche=$_POST['type recherche'];
$from=$_POST['from'];
$to=$_POST['to'];
if(isset
include("bdd.php");
if(isset ($_GET['recherche'])){
$recherche=$_GET['recherche'];
$sql="SELECT * FROM article,info_compt,locale,etage,module WHERE ref_art famil_artc ,design_artc, design_compt, marq_artc , serie_artc affect_artc, person_affect, etat_artc, LIKE '%recherche%'";
$req=mysql_query($sql) or die(mysql_error());
}
?>