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
>
>