RE: Apache-Postgres

From: "Edisnel Carrazana Castro" <ecarrazana(at)estudiantes(dot)uci(dot)cu>
To: Raúl Mero <rmero(at)marzam-online(dot)com>
Cc: "Juan" <lvcius(at)gmail(dot)com>, <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: RE: Apache-Postgres
Date: 2006-03-13 19:48:34
Message-ID: 090BCFF87A1DAB4AA2B1DC2D58A0D657A8F385@ucixs90.uci.cu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda


Saludos a todos, he probado el ejemplo que esta debajo, y se conecta bien a la base de datos, pero me da el siguiente error:

Warning: pg_exec() [function.pg-exec]: Query failed: ERROR: relation "estudiantes" does not exist in /var/www/prueba_conpostgres.php on line 33

Warning: pg_numrows(): supplied argument is not a valid PostgreSQL result resource in /var/www/prueba_conpostgres.php on line 34

Si alguien tiene alguna idea desde ya le doy las gracias, saludos

-----Original Message-----
From: pgsql-es-ayuda-owner(at)postgresql(dot)org on behalf of Raúl Mero
Sent: Mon 13.03.2006 10:04
To: Raúl Mero
Cc: Juan; pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: [pgsql-es-ayuda] Apache-Postgres

SOBRE TODO RECUERDA QUE PHP ES UNA DE LOS MEJORES LENGUAJES SCRIPTING A
NIVEL WEB QUE UTILIZA POSTGRESSQL SU USO DEBEMOS HACERLO MUY FRECUENTE
POR QUE QUE PASARIA SI TE ENCUENTRAS DE VIAJE Y NECESITAS ALGO DE LA
BASE DE POSTGRESQL ... AHHH ASI QUE NI SE PIENSE QUE NO SIRVE PARA NADA
NUESTRO AMADO PHP....

SOBRE TODO QUE VAN DE LA MANO INCREMENTANDO EL USO DEL PHP Y EXPLOTANDO
LAS CAPACIDADES DEL LA 'BASE DEL ELEFANTE' EN LA WEB

BYE

RAUL MERO
OCUPACION: DECIR LA VERDAD

Raúl Mero escribió:

>
> QUE TAL MIRA CON ESTE EJEMPLO Y DIME QUE TE SALE: colocale tus
> variables tantos de conexion como de la base de datos
>
>
> conex.php
>
>
> <!-- MODULO PARA LA CONEXION A LA BASE DE DATOS -->
>
>
> <?php
>
>
> function Conectarse()
>
>
> {
>
>
> if
>
> (!($link=mysql_connect("192.168.0.x","user_admin","password_admin")))
>
>
> {
>
>
> echo "ERROR AL CONECTARSE A LA BASE DE DATOS...";
>
>
> exit();
>
>
> }
>
>
> if (!mysql_select_db("NODOMARZAMMANTA",$link))
>
>
> {
>
>
> echo "ERROR AL CONECTARSE A LA BASE DE DATOS...";
>
>
> exit();
>
>
> }
>
>
> return $link;
>
>
> }
>
>
> ?>
>
>
>
> --------------------------------------------------------------------------------------------------------------
>
>
>
> pgsql.php
>
>
> <?
>
>
> $server = "localhost";
>
>
> $puerto = "5432";
>
>
> $database = "nodomarzammanta";
>
>
> $usuario = "Administrador";
>
>
> $clave = "ANAHI_ATHINA1233";
>
>
> // CREA LA CONEXION A POSTGRESQL
>
>
> $connection = pg_connect("host=$server port=$puerto
> dbname=$database user=$usuario password=$clave");
>
>
> // SI EXISTE ALGUN ERROR LO IMPRIME
>
>
> if (!$connection)
>
>
> {
>
>
> print("<script languaje=javascript> alert('Conexion
> Fallida En $server Conectando $database'); </script>");
>
>
> exit;
>
>
> }
>
>
> else
>
>
> {
>
>
> print("<script languaje=javascript> alert('Conexion Ok En
> $server Conectando $database'); </script>");
>
>
> }
>
>
> // declare my query and execute
>
>
> $myresult = pg_exec($connection, "select * from
> departamento");
>
>
> $rows = pg_NumRows($myresult);
>
>
> // Presenta la informacion almacenada en $resultado_set
>
>
> for ($j=0; $j < $rows; $j++)
>
>
> {
>
>
> echo "ID_DEP :<b>".pg_result($myresult, $j, 0)."</b>
>
>
> DESC_DEP :<b>".pg_result($myresult, $j, 1)."</b>
>
>
> EMPR_ID :<b>".pg_result($myresult, $j, 2)."</b><br>";
>
>
> }
>
>
> /* Cierra la conexion con la base de datos */
>
>
> pg_close($connection);
>
>
> ?>
>
>
>---------------------------(fin del mensaje)---------------------------
>TIP 7: no olvides aumentar la configuración del "free space map"
>
>
SOBRE TODO

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Kelly González Enríquez 2006-03-13 20:02:18 otra vez importacion
Previous Message Mario Gonzalez 2006-03-13 19:38:14 Re: Apache-Postgres