Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

INNER JOIN help

Locked
rradunz
Posts: 6
Joined: Fri Mar 29, 2013 11:14 pm

INNER JOIN help

Unread post 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
rradunz
Posts: 6
Joined: Fri Mar 29, 2013 11:14 pm

Re: INNER JOIN help

Unread post 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
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: INNER JOIN help

Unread post by admin »

.
Locked