Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/03/2010, 08:49
Avatar de 1010011010
1010011010
 
Fecha de Ingreso: julio-2009
Ubicación: Xanadú
Mensajes: 58
Antigüedad: 14 años, 9 meses
Puntos: 1
Pregunta Respuesta: Traducir funciones PHP de MySQL a funciones Postgres

Bueno gente revisando un poco las funciones hice esto....

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Pagina con Titulo jojooohh - Conexion PHP > pg</title>
</head>
<body>
<?PHP
$link = pg_connect("host=localhost, port=5432 , user=postgres, password=admin, dbname=conectar"); 
if (isset($link)) {
    echo "Conexion Exitosa<br>";
}
else
{
    echo "Conexion Fallida<br>";
}

$result = pg_query($link, "SELECT nombre, apellido FROM tabla");
echo "Nombre: " . pg_fetch_result($result, 0, "nombre") . "<br>";

?> 
</body>
</html>
pero el browser solo imprime esto:

Cita:
Iniciado por firefox
Conexion Exitosa
Nombre:
Estare usando las funciones adecuadas? sera un error de sintaxis???