Jump to content
  • 0

Диалоги


w1ndw0rk
 Share

Question

Хочу написать Диалоги как вКонтакте, подскажите в чем тут может быть проблема?

Чтобы do while так же выводил как вКонтакте.


<div>w1ndw0rk - v0in<div>
<div>v0in - w1ndw0rk<div>

http://cs5870.vk.com/u10393717/107424414/x_a9c1abda.jpg


$dialog_res = mysql_query("SELECT * FROM messages WHERE author='$login' ORDER BY id DESC") ;
$dialog_row = mysql_fetch_array($dialog_res) ;

//************************************************
//************************************************
if (!empty($dialog_row['id'])) {
do{
$user_res = mysql_query("SELECT * FROM users WHERE login='$login'") ;
$user_row = mysql_fetch_array($user_res);

//************************************************

$addressee = $dialog_row['addressee'] ;
$addressee_res = mysql_query("SELECT * FROM users WHERE login='$addressee'") ;
$addressee_row = mysql_fetch_array($addressee_res) ;

//************************************************

if (!empty($user_row['avatar_mini']) and !empty($addressee_row['avatar_mini'])) {
$user_mini = $user_row['avatar_mini'] ;
$adderssee_mini = $adderssee_row['avatar_mini'] ;
}
else {
$user_avatar_mini = "images/avatars/no-photo.jpg" ;
$adderssee_avatar_mini = "images/avatars/no-photo.jpg" ;
}
printf('<div>%s - %s</div><br>',$user_row['name'], $addressee_row['name']);

}
while($dialog_row = mysql_fetch_array($dialog_res));

}
else {
echo '<div class="mail_box_no_mass">Диалогов нет.</div>';
}

Edited by w1ndw0rk
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy