query db- prepare SELECT image time FROM bonus WHERE time and typ and

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$query = $db->prepare("SELECT `image`,`time` FROM `bonus`
WHERE `time`>? and `typ`!='1'
and `usr`=?
");
$query->execute(array (
time(),
$user['id']
));
if ($query->rowCount() > 0)
{
$data = $query->fetchAll(PDO::FETCH_ASSOC);
if (is_array($data) )
{
echo '<div class ="float-right"/>';
foreach ($data as $row)
{
?>
<img src="/images/bonus/<?php echo $row['image'];?>.png"
width="15" height="15">
<?php ($row['image'] == '14' ? date ('s сек',$row['time']-time()))
}
}
}