I'm running an app from a store where users can leave equipment to be arranged. So I did a php to look for those users who have already left some equipment by name:
$sql = mysqli_query("$conexao,
SELECT u.contribuinte, u.nome, u.tlm
FROM utilizador u, entrada e
WHERE u.contribuinte = e.contribuinte
AND u.nome LIKE '%".$utilizador."%'
ORDER BY e.data_entrada DESC
");
However in the query above I get these results, but I also wanted to get the users regardless if they already left some equipment or not. In other words, I want all users to appear, with priority being given to those who have already left some equipment.
This is the first time I've seen such a case, but I think it's possible to do this query. Thanks in advance for the help:)