query DB dbs query SELECT FROM табла где ники WHERE us id if query row

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
$query = DB :: $dbs -> query ("SELECT * FROM `табла где ники` WHERE (`us`='" . $u['id'] . "')");
if($query -> rowCount () == 0) {
echo Nick ($u['id']) . ' не менял ник!';
}
else {
$query = DB :: $dbs -> query ("SELECT * FROM `табла где ники` WHERE (`user`='" . $u['id'] . "') ORDER BY `id` DESC");
while ($nick = $query -> fetch ()) {
echo '<b>' . $nick['old'] . '</b> -> <b>' . $nick['new'] . '</b><br>Смена: ' . Nick ($nick['kem']) . ' (' . datef ($nick['time']) . ')<hr/>';
}
echo '</div>';
}