Ok, so I have two tables in my database, users and message_info.
Users consists of the following fields:
id
username
password
email
message_info consists of:
message_info_id
user_id
blocked_ids
message_count
In the message_count table I am storing a comma seperated list of user ids in the blocked_ids field for example:
blocked_ids: 2,1,4,6
Using this list, I want to get all the corresponding usernames from the user table. I am currently using the following SQL:
SELECT username, id FROM users, message_info WHERE users.id IN (message_info.blocked_ids)
altho this only returns one row (the first id in the blocked_ids field).
Where am I going wrong with the query?