Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/10/2009, 13:44
Avatar de gjx2
gjx2
 
Fecha de Ingreso: agosto-2008
Ubicación: R.D
Mensajes: 1.153
Antigüedad: 15 años, 8 meses
Puntos: 139
Respuesta: If en AutoSuggest

Bueno pues seria algo haci
ubica la parte donde tienes el if($query)


Código PHP:
Ver original
  1. if($query) { // BUSCA ESTA PARTE EN TU CODIGO
  2.              
  3.                 if(mysql_num_rows() > 0){
  4.                     // While there are results loop through them - fetching an Object (i like PHP5 btw!).
  5.                     while ($result = $query ->fetch_object()) {
  6.                         // Format the results, im using <li> for the list, you can change it.
  7.                         // The onClick function fills the textbox with the result.
  8.                          
  9.                         // YOU MUST CHANGE: $result->value to $result->your_column
  10.                         // AutoFill Search Field:
  11.                          echo '<li><a href="search.php?Search='.$result->part.'">'.$result->part.'</a></li>';
  12.                      }
  13.                  
  14.                  }else{
  15.                  
  16.                     echo "<script>alert('No encontrado, por favor contactanos');</script>";
  17.                  
  18.                  }
  19.                  
  20.                  
  21.                  
  22.                 } else {
  23.                     echo 'ERROR: There was a problem with the query.';
  24.                 }