On my website I am trying to program a feature where a user can choose to get 'updates' from another user. When a user clicks 'receive updates,' it throws that users ID in the database, alongside with other users they want to receive updates from. For Example (4,5,6,7,8). My tables look like this
members | updates
-----------------
id | id
updates | member_id
| content
| content_date
When I query the database I want to pull out of the updates table only the updates from the already specified users in members:updates.
$sql_updates = mysql_query("SELECT *
FROM updates a,
members b
WHERE a.member_id IN b.updates
ORDER BY a.content_date DESC
LIMIT 10");
while($row = mysql_fetch_array($sql_updates)) {
Is this the best way to go about it?
b.updatescolumn store the values as a comma delimited list?