Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/04/2007, 12:21
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Re: no lee base de datos

Código PHP:
<?php
function Conectarse()
{
    if (!(
$link=mysql_connect("localhost","root","")))
    {
        echo 
"Error conectando a la base de datos.";
        exit();
    }
    if (!
mysql_select_db("siglas",$link))
    {
        echo 
"Error seleccionando la base de datos.";
        exit();
    }
    return 
$link;
}
$link Conectarse();
$result=mysql_query("SELECT * FROM meanings"$link);
while (
$row mysql_fetch_array($result)) {
    print 
$row["Sigla"],$row["Meaning"],$row["Explanation"];
    }
    
mysql_close($link);
?>
Nunca llamas a la funcion para establecer la conexion.