0
In my system I have two tables, one with user registrations, obviously, each one has its ID.
And another table where are placed the data sending gifts from one user to another, but only appear the Ids of who sends and who receives.
I added two more columns in the gift table that would be for the names and username of the users who received the gift, so I knew who received by name and not by ID.
My idea would be to update/insert the names and usernames by comparing the ID of who received with the ID of the user table.
Just for the record, I bought the system ready and wanted to implement, I tried to replace anyway so that the names were already for table, but nothing done.
Buddy, I could not by this way, but just to have presented the function I looked for another way and got.
SELECT users.fullname, users.login, gifts.giftId, gifts.status, gifts.id
FROM users
INNER JOIN gifts ON users.id = gifts.giftTo
– Ayslan Carolli
But that was the idea, I only used generic names because I didn’t know the real names of their tables.
– Roberto de Campos