Nabla Iluig Ed Nabla Iluig Ed - 1 month ago 7
SQL Question

SQL request return nothing

I try to get all row from a parkplaces table + the username row from users table.
All results must have status (from parkplaces table) row equal to 'current'.
Results must be sort by order asc.

Here is my request:

SELECT parkplaces.*, users.username
FROM parkplaces INNER JOIN users ON parkplaces.id_user = users.id
WHERE status = 'current'
ORDER BY parkplaces.id ASC


When I try, the request return nothing.

What's wrong please, im little confused.

Thanks

Answer

What I can see, you are trying to get admin.username

But the table is "users"? Should it be:

SELECT parkplaces.*, users.username 
FROM parkplaces