pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jackson, DeJuan <djackson@cpsgroup.com>
To: jpmarichal@infoacces.com
To: php3@lists.php.net
Cc: PGSQL SQL <pgsql-sql@postgresql.org>
Subject: RE: [PHP3] PLEASE, HELP!
Date: Wed, 27 Jan 1999 12:14:25 -0600
Message-ID: <F10BB1FAF801D111829B0060971D839F61D158@cpsmail> (raw)

TRY:
SELECT participantes.idven, 
participantes.nombreven, participantes.iding, 
participantes.nombreing, participantes.empresa, 
ordenes.num_ordenuf, ordenes.factura_spasp, 
ordenes.factura_vad, ordenes.fecha, ordenes.num_producto, 
productos.descripcion, ordenes.mayorista, productos.puntos, 
ordenes.cantidad, puntos*cantidad AS "Total" 
FROM productos, participantes, ordenes
WHERE participantes.idven = ordenes.participante AND
      idproducto = ordenes.num_producto AND 
      participantes.idven="VHA1901081"

Postgres doesn't yet support the SQL 92 INNER JOIN Syntax.  It should be
fairly obvious what I did to your original query if you look closely.
	-DEJ

> You're right, I've prove it. Now, anybody may help me to 
> locate the error? 
> 
> See, once that I convert all to lowercase, PHP still send me 
> this error:
> 
> Warning: PostgresSQL query failed: ERROR: parser: parse error 
> at or near "inner" in 
> /usr/local/apache/share/htdocs/consulta_concentrado.php3 on line 18
> 
> The query is now the following:
> 
> $result=pg_Exec($conn,"select idven, nombreven, iding, 
> nombreing, empresa, num_ordenuf, factura_spasp, factura_vad, 
> fecha, num_producto, descripcion, mayorista, puntos, cantidad 
> from productos inner join participantes inner join ordenes on 
> participantes.idven = ordenes.participante on 
> productos.idproducto = ordenes.num_producto where 
> idven='VHA1901081'");
> 
> $result is 0 (fail). I'm not still using the . operator in 
> all the clauses, but I'm sure that the problem is not located 
> there. I'm getting crazy trying to isolate the problem. 
> Somebody has any idea?
> 
> 
> *********** REPLY SEPARATOR ***********
> 
> On 27/01/99, at 12:53 PM, Jeremiah Davis wrote: 
> 
> >Actually, Postgres does accept the . operator in the form
> >
> >SELECT table.column,table2.column,table3.column FROM 
> table,table2,table3;
> >
> >Your problem is somewhere else in the SQL code that access 
> generated for
> >you.
> >
> >
> >On Wed, 27 Jan 1999, Juan Pablo Marichal Catalan wrote:
> >
> >> I cant' find the way!
> >> 
> >> I'm building a system to a contest. I have three tables: 
> participantes (partakers), ordenes (orders) and productos 
> (products). Partakers on the contest introduce their id in an 
> HTML form, then this calls a PHP to query the database and 
> return data taken from the three tables.
> >> 
> >> Using Microsoft Access, I get the SQL code for the query, 
> then I copy it and paste it in my PHP code:
> >> 
> >> $result=pg_Exec($conn,"SELECT participantes.idven, 
> participantes.nombreven, participantes.iding, 
> participantes.nombreing, participantes.empresa, 
> ordenes.num_ordenuf, ordenes.factura_spasp, 
> ordenes.factura_vad, ordenes.fecha, ordenes.num_producto, 
> productos.descripcion, ordenes.mayorista, productos.puntos, 
> ordenes.cantidad, [puntos]*[cantidad] AS Total FROM productos 
> INNER JOIN (participantes INNER JOIN ordenes ON idven = 
> participante) ON idproducto = num_producto WHERE 
> (((idven)="VHA1901081"))");
> >> 
> >> But Postgress don't accept the . operator, so it drops to 
> me those nasty 'parse' error messages. I don't know if it's 
> only due to the . operator, or the use of upper case or what. 
> How must I build the SQL query to be accepted by Postgress 
> and PHP? I'm drowning on it!
> >> 
> >> 
> >> ______________________
> >> Brotherly,
> >> JPMarichal
> >> jpmarichal@infoacces.com
> >> ICQ# 17246887
> >> 
> >> --
> >> PHP 3 Mailing List   http://www.php.net/
> >> To unsubscribe send an empty message to 
> php3-unsubscribe@lists.php.net
> >> To subscribe to the digest list:  
> php3-digest-subscribe@lists.php.net
> >> For help: php3-help@lists.php.net  Archive:  
> http://www.php.net/mailsearch.php3
> >> List administrator:  
> zeev-list-admin@zend.com
> >> 
> >>
> 
> ______________________
> Brotherly,
> JPMarichal
> jpmarichal@infoacces.com
> ICQ# 17246887
> 
> --
> PHP 3 Mailing List   http://www.php.net/
> To unsubscribe send an empty message to php3-unsubscribe@lists.php.net
> To subscribe to the digest list:  php3-digest-subscribe@lists.php.net
> For help: php3-help@lists.php.net  Archive:  
> http://www.php.net/mailsearch.php3
> List administrator:  
> zeev-list-admin@zend.com
> 
> 



view thread (7+ messages)  latest in thread

Message-ID: <F10BB1FAF801D111829B0060971D839F61D158@cpsmail>
Permalink:  ../F10BB1FAF801D111829B0060971D839F61D158@cpsmail/
Also on:    postgresql.org/message-id/F10BB1FAF801D111829B0060971D839F61D158@cpsmail

 · 

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-sql@postgresql.org
  Cc: djackson@cpsgroup.com, jpmarichal@infoacces.com, php3@lists.php.net
  Subject: Re: [PHP3] PLEASE, HELP!
  In-Reply-To: <F10BB1FAF801D111829B0060971D839F61D158@cpsmail>
  References: <F10BB1FAF801D111829B0060971D839F61D158@cpsmail>

* 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