c__ db- query SELECT FROM lenta WHERE object_id object_id AND id_who i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
$c__ = $db->query("SELECT * FROM `lenta`
WHERE `object_id` < '" . $a['object_id'] . "'
AND `id_who` = '" . $a['id_who'] . "'
AND `type` = 'file'");
if ($c__->rowCount()) {
$db->query("DELETE FROM `lenta`
WHERE `object_id` < '" . $a['object_id'] . "'
AND `id_who` = '" . $a['id_who'] . "'
AND `type` = 'file'");
header("Location: /lenta/");
}