query DB dbs query SELECT FROM nicks WHERE users id echo href users ph

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
$query = DB :: $dbs -> query ("SELECT * FROM `nicks` WHERE (`users`='" . $u['id'] . "')");
echo ' <a href="/users.php?' . $u['id'] . '?nicks">История ников</a> (' . $query -> rowCount () .')';
if (isset ($_GET['nicks'])) {
echo '<div class="main">';
if($query -> rowCount () == 0) {
echo Nick ($u['id']) . ' не менял ник!';
}
else {
$query = DB :: $dbs -> query ("SELECT * FROM `user_nicks` WHERE (`users`='" . $u['id'] . "') ORDER BY `id` DESC");
while ($nick = $query -> fetch ()) {
echo '<b>' . $nick['old'] . '</b> -> <b>' . $nick['new'] . '</b><br>Сменил: ' . Nick ($nick['kem']) . ' (' . date ($nick['time']) . ')<hr/>';
}
}
echo '</div>';
}