On my website I am trying to program a feature, similar to facebook and twitters timeline, where a user can 'follow' another user, and receive their 'broadcast'. The database tables are:
**members**
--------
id
fullname
following
**broadcasts**
-----------
id
mem_id
broadcast (the content)
broadcast_date
"following" in the members table is a varchar text that stores user ID's. So if I'm following users 4 5 and 6 (4,5,6,) would appear in the following column. My problem is, what I'm querying from the database, it's only retrieving the 'broadcasts' from the first user that I am following and no other user else.
$sql_broadcasts = mysql_query("
SELECT *
FROM members
JOIN broadcast
ON(broadcast.mem_id = members.following)
WHERE members.id=$id
ORDER BY broadcast_date DESC
LIMIT 10;
");
where $id is $_SESSION['id']. I've been staring at this code for a long time, can anyone spot what I'm doing wrong? thanks in advance
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)