$sth = $dbh->prepare("SELECT * FROM `catalog` WHERE `id` = ? ORDER BY `date_add` DESC");
$sth->execute([intval($_GET['id'])]);
$id = intval($_GET['id']);
$sth = $dbh->prepare("SELECT * FROM `catalog` WHERE `id` = :id ORDER BY `date_add` DESC");
$sth->bindParam('id', $id, PDO::PARAM_INT);
$sth->execute();
$color = imagecolorallocatealpha($img, 0, 0, 0, 63); //последний аргумент от 0 до 127
imagefilledrectangle($img, 0, 0, $w-1, $h-1, $color);