Ver Mensaje Individual
  #14 (permalink)  
Antiguo 17/07/2011, 09:45
luisgzafra
 
Fecha de Ingreso: noviembre-2010
Mensajes: 1.242
Antigüedad: 13 años, 5 meses
Puntos: 73
Respuesta: Extraer parecidos

Aquí lo puse: http://beta.tuentimp3.com/a.php

Con
Código PHP:
Ver original
  1. define ('HOSTDB', 'localhost');
  2. define ('USERDB', '**********');
  3. define ('PASSDB', '**********');
  4. define ('NAMEDB', '**********');
  5.  
  6. function parecido ($q){
  7. $conexion = mysql_connect(HOSTDB, USERDB, PASSDB);
  8. mysql_select_db(NAMEDB, $conexion);
  9. *
  10. $queEmp = "SELECT * FROM queries WHERE query LIKE '%$q%'";
  11. $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
  12. $totEmp = mysql_num_rows($resEmp);
  13. *
  14. $resultSet = array();
  15. while ($rowEmp = mysql_fetch_assoc($resEmp)) {
  16. * * $resultSet[] = $rowEmp['query']; *
  17. }
  18. return $resultSet;
  19. *
  20. }
  21. print_r(parecido('huecc'));

Y me devuelve un error interno
__________________
:)