Page 1 of 1

INNER JOIN help

Posted: Tue Apr 02, 2013 7:54 pm
by rradunz
I am trying to use INNER JOIN (in the general tab of the form - SQL field) but always receive the "blue screen" with lots of information that may be useful for an expert, but not for me unfortunately.

Can someone point me to a way to find the SQL syntax error using some form of debug?

This SQL statement runs fine inside PHPadmin, gives error in form:

SELECT *
FROM sea_fretes INNER JOIN sea_forn_contatos
ON sea_forn_contatos.forcon_id = sea_fretes.forcon_id
ORDER BY sea_fretes.fre_id

in the blue screen it is expanded to:

SELECT forcon_id, fre_status, fre_datapedido, fre_dataagendada, fre_turno, fre_celularcli, fre_cliente, fre_endereco, fre_bairro, fre_cidade, fre_CEP, fre_estado, fre_id FROM sea_fretes INNER JOIN sea_forn_contatos ON sea_forn_contatos.forcon_id = sea_fretes.forcon_id ORDER BY sea_fretes.fre_id

thanks!
RR

Re: INNER JOIN help

Posted: Tue Apr 02, 2013 11:18 pm
by rradunz
the join worked after I changed the name of the FK field to be different from the PK of the second table.

SELECT *
FROM sea_fretes
JOIN sea_forn_contatos
ON contato_id = forcon_id

Re: INNER JOIN help

Posted: Tue Apr 09, 2013 1:12 am
by admin
.