In my table restaurant
there is one column rest_admin
.
This contains the id of the admin who's logged in.
This ID is stored in $_SESSION['adminSession']
.
To select all restaurants for this admin I use this query:
SELECT * FROM restaurant INNER JOIN city ON restaurant.rest_city=city.city_id WHERE rest_admin=:rest_admin_id
:rest_admin_id=$_SESSION['adminSession']
So far so good, no problem.
Now I want multiple admins for one restaurant, still in the same column but the ID's separated by comma's like:
1, 6, 9, 24
Now my question is, in this case, how can I select only the restaurants where the logged in admin is one of the admins?