0
Hello, in my project I need to list the people and requests received by the user, but when listing people, I need to list only those who did not submit or that the user did not submit requests, in case, my friendship table keeps the status of the request, being 0 for pending
SELECT * FROM tbUsuario user JOIN tbAmizade am, tbGenMus gen WHERE NOT
((am.fkUsuarioSend = user.usId AND am.fkUsuarioReceive = {$_SESSION['usuario']['usId']})
OR (am.fkUsuarioSend = {$_SESSION['usuario']['usId']} AND am.fkUsuarioReceive = user.UsId))
AND NOT user.usId = {$_SESSION['usuario']['usId']} AND gen.idGenMus = user.fkGenMus;
created this query and worked for a moment, but when the user sent more than one request, the query started to duplicate the results and put the ones that should not appear.
Clarify your specific issue or add other details to highlight exactly what you need. The way it’s written here, it’s hard to know exactly what you’re asking. See the How to Ask page for help clarifying this question.
– Caique Romero