I currently have 2 tables in a MySql database.
Structure:
messages
id | content | user_id | time
submessages
id | subcontent | msg_id | user_id | time
In the submessages
table, column msg_id
is a foreign key, referencing the id
column in table messages
.
Now i need to query from php
$cur_userID = $user->current_id; // current user id.
SELECT * FROM messages WHERE id > '{$_GET['id']}' // problem here
How do I query the submessages
table for subcontent
that was posted by other users - exlcuding current user?
Meaning anything with a user_id
equal to $cur_userID
shouldn't be displayed.
Thank you.