SELECT works in phpMyAdmin but in php application the same SELECT does not work

Asked

Viewed 34 times

-2

inserir a descrição da imagem aquiI have an order table with two foreign keys, sender and recipient which is the primary key of the person table. When I do SELECT in phpMyAdmin the result is correct. But in my application the name of the sender and recipient is the same. See the image

  • Without you posting the query used in the application it is difficult to know what is wrong. Post as text and not image.

1 answer

0

Lucas, by his image, noticed that both the name of the sender and the recipient are returning in a column called "Name". If the query is the same in the application, when it is time to fetch the result you will only have the name of one of the two in the query result map. I suggest to put an alias for each of the names in the query itself, as in the example below:

SELECT .... reme.nomePessoa as NomeReme, dest.nomePessoa as NomeDest...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.