|
La Communauté Webmaster 
| Pages: [1] |
 |
|
|
|
Auteur |
Sujet: Probleme script moteur de recherche (Lu 1277 fois) |
|
 |
Probleme script moteur de recherche
« sur: le 30-10-2007 a 01:11:40 » |
|
|
|
|
|
|
 |
Re:Probleme script moteur de recherche
« Répondre #1 sur: le 30-10-2007 a 13:42:17 » |
|
GoldRazor
P'tit nouveau
 
Hors-Ligne
Messages: 79

|
Merci pour vos interventions, le mot clef est bien recuperé par REQUEST.
J'ai mieu organisé mon code :
<?php
$motclef=$_REQUEST['motclef']; $parpage=15; $sql = "SELECT COUNT(*) AS `stats` FROM `annonces` WHERE INSTR (titre, $motclef) OR INSTR (description, $motclef)"; $sql2 = mysql_query($sql); $sql3 = mysql_fetch_object($sql2);
echo "<br><br>SQL1 : $sql <br><br>"; echo "<br><br>SQL2 : $sql2 <br><br>"; echo "<br><br>SQL3 : $sql3 <br><br>";
$total=$stats->stats; $_GET['debut']=$_GET['debut']*1;
$req="SELECT * FROM `annonces` WHERE INSTR (titre, '$motclef') OR INSTR (description, '$motclef') ORDER BY `date` DESC LIMIT ".$_GET['debut'].",$parpage"; $req2 = mysql_query($req); echo "<br><br>REQ1 : $req <br><br>"; echo "<br><br>REQ2 : $req2 <br><br>"; $ocp=0; while($annonces=mysql_fetch_array($req2)){ $ocp+=1; ?> |
|
Voici ce que renvoi le code sur une recherche 'PS3' :
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\wamp\www\destockage\search.php on line 274
SQL1 : SELECT COUNT(*) AS `stats` FROM `annonces` WHERE INSTR (titre, PS3) OR INSTR (description, PS3)
SQL2 :
SQL3 :
REQ1 : SELECT * FROM `annonces` WHERE INSTR (titre, 'PS3') OR INSTR (description, 'PS3') ORDER BY `date` DESC LIMIT 0,15
REQ2 :
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\destockage\search.php on line 292
Si vous avez une idée, n'hasitez pas. Merci beaucoup |
|
|
|
|
 |
Re:Probleme script moteur de recherche
« Répondre #2 sur: le 30-10-2007 a 19:08:58 » |
|
|
|
|
 |
Re:Probleme script moteur de recherche
« Répondre #3 sur: le 30-10-2007 a 19:13:08 » |
|
|
|
|
| Pages:
[1] |
|
|
|
| |
|
|