From: | Rhyno Elmer <rhynos(at)gmail(dot)com> |
---|---|
To: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Warning: pg_query() [function.pg-query]: Query failed: ERROR: relation |
Date: | 2009-08-04 15:53:01 |
Message-ID: | 2432be200908040853h62bf4bdex49d0a3f09202b040@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Buenas.
No entiendo mucho Postgre, trabajo en MySql y necesito pasar un sistema a
Postgre, tengo instalado todo bien, tengo la conexion bien hecha, pero al
tratar de hacer una conexion con mi BD me tira un error.
*Warning*: pg_exec(): supplied argument is not a valid PostgreSQL link
resource in *D:\htdocs\tic\index.php* on line *6*
*Warning*: pg_numrows(): supplied argument is not a valid PostgreSQL result
resource in *D:\htdocs\tic\index.php* on line *7*
Number of rows:
*Warning*: pg_freeresult(): supplied argument is not a valid PostgreSQL
result resource in *D:\htdocs\tic\index.php* on line *8*
*Warning*: pg_close(): supplied argument is not a valid PostgreSQL link
resource in *D:\htdocs\tic\index.php* on line *9**
*Mi BD tiene dos usuarios, postgres y consultas, los dos con todos los
Privilegios. Si me pudieran orientar sobre esto se agradeceria.
Los php con cual estoy trabajando son los siguientes:
connect.php
<?
$bdconn = pg_connect("host=localhost dbname=template1 port=5432
user=consultas password=XXXX");
if (pg_ErrorMessage($bdconn)) { echo "<p><b>Error conectando a la base de
datos: .</b></p>"; exit; }
?>
index.php
<?
include('connect.php');
$query = "SELECT * FROM prueba";
$result = pg_exec($db_handle, $query);
echo "Number of rows: " . pg_numrows($result);
pg_freeresult($result);
pg_close($db_handle);
?>
Rhynos
From | Date | Subject | |
---|---|---|---|
Next Message | felipe fernandez | 2009-08-04 15:57:13 | Re: Warning: pg_query() [function.pg-query]: Query failed: ERROR: relation |
Previous Message | Enzo Diaz | 2009-08-04 15:41:47 | RE: Problema con Encoding |