pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Wenk <a.wenk@netzmeister-st-pauli.de>
To: Jhonny Velasquez c. <jhon_vels@hotmail.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-php@postgresql.org
Subject: Re:
Date: Sat, 07 Mar 2009 18:42:23 +0100
Message-ID: <49B2B1FF.40803@netzmeister-st-pauli.de> (raw)
In-Reply-To: <SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl>
References: <SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl>



Jhonny Velasquez c. schrieb:
> hola a todos

Hi,

this is the english mailinglist ... ther's also an spanish mailinglist I 
guess ;-)

> estoy programando en php
> tengo el siguiente esquema de BD
>  
> BDACADEMICA
>  personas(idpersona, nombres, paterno)
> 
> BDSIAP
>  PersonasDatosActualizables(idpersona, direccion, telefono)
> 
>  
> son dos bases de datos, de las cuales mediante una sola consulta quiero 
> unir los datos de la misma persona, creo que se puede hacer con dblink, 
> no se si hay otra forma mejor.
>  
>    $result=pg_query( $linkacademica,"SELECT personas.nombres, 
> personas.paterno, s.direccion, s.telefono, FROM personas INNER JOIN 
> dblink('dbname=bdsiap port=5432 host=localhost user=usuario 
> password=clave,'SELECT idpersona, direccion, telefono FROM 
> personasdatosactualizables') AS s(idpersona character(15), 
> direccion character varying(50), telefono character varying(25)) ON 
> personas.idpersona = s.idpersona");
> 


Kick away the "komma" (,) befor FROM

$result=pg_query( $linkacademica,"SELECT personas.nombres,
 > personas.paterno, s.direccion, s.telefono FROM personas INNER JOIN

Cheers

Andy

> usando db link me da el siguiente error, supongo que es por las 
> comillas, he intentado con comillas dobles y simples pero nada, tambien 
> he intentado usar variables.
> 
> *Warning*: pg_query() [function.pg-query 
> <http://192.168.1.2/finanzas/function.pg-query;]: Query failed: ERROR: 
> error de sintaxis en o cerca de «FROM» at character 69 in 
> */var/www/finanzas/prueba.php* on line *16*
> ** 
> ** 
> espero su ayuda
>  
> saludos
>  
> jhonvels <mailto:pgsql-php@postgresql.org>
> 
> ------------------------------------------------------------------------
> check out the rest of the Windows Live™. More than mail–Windows Live™ 
> goes way beyond your inbox. More than messages 
> <http://www.microsoft.com/windows/windowslive/;

-- 
----------------------------------
Netzmeister St.Pauli

St.Pauli - Hamburg - Germany

Andreas Wenk

Lutterothstr 82
20255 Hamburg

Tel.: +49 (0) 40 319 43 54

http://www.netzmeister-st-pauli.de
mailto:a.wenk@netzmeister-st-pauli.de



view thread (4+ messages)  latest in thread

Message-ID: <49B2B1FF.40803@netzmeister-st-pauli.de>
Permalink:  ../49B2B1FF.40803@netzmeister-st-pauli.de/
Also on:    postgresql.org/message-id/49B2B1FF.40803@netzmeister-st-pauli.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: a.wenk@netzmeister-st-pauli.de, jhon_vels@hotmail.com, pgsql-sql@postgresql.org
  Subject: Re: 
  In-Reply-To: <49B2B1FF.40803@netzmeister-st-pauli.de>
  References: <SNT102-W2BDF6938BB309DC4A240C9FA40@phx.gbl> <49B2B1FF.40803@netzmeister-st-pauli.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox