I wanted to know if it is possible for a mysql_query
to search and ORDER it according to newer updates from another table for example ..
I have this query , when the user logs in to the chat he gives a list of all the registered users, but only shows the ones that are his / her friends added.
$sqln = mysql_query("SELECT * FROM users WHERE (id = '$id') OR (id IN (SELECT user2_id FROM following WHERE user1_id='$id')) ORDER BY id ASC ");
But I would like to know if instead of looking at the users table, listing ASC
sorted by id
, search another table chat
wherehewouldfindtheidoftheperson,(id_de
),andbringbackthemostrecentmessagestogetsomethingmoreup-to-datebyfirstlistingthemostrecentconversations..suchasapplicationslikeWHATSAPP.
Did you understand?