Forked from anonymous/gist:de57b16b93f3ff1cbab0d779ac76f62a
Last active
January 28, 2018 15:28
-
-
Save exileed/36dc4a8381d545cbaecc96f5de4568e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user_id = $_SESSION['user']['id']; | |
$STH = $pdo->query ( "SELECT * FROM dialog WHERE recive = $user_id OR send = $user_id ORDER by id DESC" ); | |
$STH->setFetchMode ( PDO::FETCH_OBJ ); | |
$row = $STH->fetch (); | |
$us_log1 = $row->send; | |
$us_log2 = $row->recive; | |
if ($us_log2 == $user_id) ($us_log2 = $us_log1); | |
$STH = $pdo->query ( "SELECT * FROM `users`); | |
$STH->setFetchMode ( PDO::FETCH_OBJ ); | |
$users = $STH->fetchAll(); | |
$STH = $pdo->query ( "SELECT * FROM dialog WHERE recive = $user_id OR send = $user_id ORDER by id DESC" ); | |
$STH->setFetchMode ( PDO::FETCH_OBJ ); | |
while ($row = $STH->fetchAll()) { | |
?> | |
<div class="dialogi"> | |
<div id="123">отправитель <?=$users[$row->recive]->login?> получатель <?=$users[$row->send]->login?></b></div> | |
</div> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment