Skip to content

Instantly share code, notes, and snippets.

Created January 28, 2018 15:13
Show Gist options
  • Save anonymous/de57b16b93f3ff1cbab0d779ac76f62a to your computer and use it in GitHub Desktop.
Save anonymous/de57b16b93f3ff1cbab0d779ac76f62a to your computer and use it in GitHub Desktop.
$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 `login` FROM `users` WHERE `id` = $us_log1" )
;$STH->setFetchMode ( PDO::FETCH_OBJ );
$row1212121 = $STH->fetch();
$us_looog = $row1212121->login;
$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->fetch ()) {
?>
<div class="dialogi">
<div id="123"><?=$us_looog?></b></div>
</div>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment