Answer the question
In order to leave comments, you need to log in
How to sort user's dialogs and create correct list?
There is a table
id - numbering
ot - sender
po - recipient
tex - message text
rand - unique number of dialogs
time - sending time
The problem is that I want to sort and display those to whom you sent messages. Like dialogues in social networks, so that the one you sent the last message to was at the top. Through order by id, desc is obtained in the test on the phpmyadmin itself, but it is not sorted on the site itself, please help.
<?php
$query = mysql_query("SELECT DISTINCT `po` from `stena` WHERE `ot` = '".$userdata['users_id']."'
GROUP BY id DESC ");
while($row = mysql_fetch_array($query)) {
$queryy = mysql_query("SELECT * from users ");
while($roww = mysql_fetch_array($queryy)) {
echo '<tr><td>';
if ($row['po'] == $roww['users_id']) {
echo $roww['users_login'];
}
echo '</td></tr>';
}
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question