Tema: Ayuda please
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/12/2009, 08:43
Avatar de Marvin
Marvin
Colaborador
 
Fecha de Ingreso: febrero-2005
Ubicación: global $Chile->Santiago;
Mensajes: 1.991
Antigüedad: 20 años, 1 mes
Puntos: 81
Respuesta: Ayuda please

Lo unico que debes hacer es agregar en tu query lo que quieres sacar de la base de datos.

Esto basicamente es SQL y no mucho PHP.

Pero te muestro un ejemplo (asumiendo que quiero agregar el campo FARM:
Código PHP:
                //AGREGAS ACA TU CAMPO FARM
                
$query $db->query("SELECT Nombre_med, FARM FROM Med_Medicamentos WHERE Nombre_med LIKE '$queryString%' LIMIT 10");
                if(
$query) {
                    
// While there are results loop through them - fetching an Object (i like PHP5 btw!).
                    
while ($result $query ->fetch_object()) {
                    
// Format the results, im using <li> for the list, you can change it.
                    // The onClick function fills the textbox with the result.
                    // YOU MUST CHANGE: $result->value to $result->your_colum
                        
echo '<li onClick="fill(\''.$result->Nombre_med.'\');">'.$result->Nombre_med.'</li>';
                        
//AGREGAS ESTA LINEA PARA VER EL RESULTADO EN PANTALLA
                        
echo '<li onClick="fill(\''.$result->FARM.'\');">'.$result->FARM.'</li>';
                    } 
Suerte!
__________________
El que dice "Solo sé que nada sé", esta asumiendo que sabe algo.
Lea las FAQ's!