Ver Mensaje Individual
  #10 (permalink)  
Antiguo 11/04/2010, 11:28
den_22
 
Fecha de Ingreso: enero-2010
Mensajes: 198
Antigüedad: 14 años, 3 meses
Puntos: 1
Respuesta: Haciendo el buscador(problemas)

Hola, por las dudas posteo el codigo del buscador por palabras, por favor si alguien me puede ayudar con el del select, le agradeceria mucho.

gracias.

den_22



Código PHP:
Ver original
  1. <?php
  2.  
  3.  
  4.  
  5.  
  6. error_reporting(E_ALL ^ E_NOTICE);
  7. include("connect.php");
  8. $usuario=$_SESSION['usuario'];
  9.  
  10.  
  11. if ($_GET['search']=="firstname"){
  12.             $firstname = $_POST['firstname'];
  13.             $query = mysql_query("SELECT * FROM prueba WHERE firstname LIKE '%$firstname%' ORDER BY firstname DESC LIMIT 40");
  14.            
  15.             if (mysql_num_rows($query)==0){
  16. } else {
  17.             while($user_ok = mysql_fetch_array($query)){
  18.  
  19. } } }
  20.  
  21.  
  22.         if ($_GET['search']=="lastname"){
  23.             $lastname = $_POST['lastname'];
  24.             $query = mysql_query("SELECT * FROM prueba WHERE lastname LIKE '%$lastname%' ORDER BY lastname DESC LIMIT 40");
  25.            
  26.             if (mysql_num_rows($query)==0){
  27.  
  28.             } else {
  29.             while($user_ok= mysql_fetch_array($query)){
  30.  
  31. } } }
  32.  
  33. if ($_GET['search']=="favourite_music"){
  34.             $favourite_music = $_POST['favourite_music'];
  35.             $query = mysql_query("SELECT * FROM prueba WHERE favourite_music LIKE '%$favourite_music%'  ORDER BY favourite_music DESC LIMIT 40");
  36.            
  37.             if (mysql_num_rows($query)==0){
  38.                
  39.                 } else {
  40.             while($user_ok = mysql_fetch_array($query)){
  41.                
  42.                 } } }
  43.                
  44.                             if ($_GET['search']=="favourite_movie"){
  45.             $favourite_movie = $_POST['favourite_movie'];
  46.             $query = mysql_query("SELECT * FROM prueba WHERE favourite_movie LIKE '%$favourite_movie%' ORDER BY favourite_movie DESC LIMIT 40");
  47.            
  48.             if (mysql_num_rows($query)==0){
  49.                 } else {
  50.             while($user_ok = mysql_fetch_array($query)){
  51.                
  52.                 } } }
  53.  
  54.  
  55.  
  56. ?>


en el html pongo <?php echo $user_ok['favourite_movie']; ?>