in the code block below, I want to add the gecerligun(number 1-9999) plus the date in the belge_tarihi (d-m-Y) column in the tbl_files table. In the current situation, it adds to today’s date as much as the current number.
$statement = $this->dbh->prepare("SELECT gecerli_gun FROM tbl_categories WHERE id = :id");
$statement->bindParam(':id', $kategoriId, PDO::PARAM_INT);
$statement->execute();
$gecerligun = 0;
$row = $statement->fetch() ;
$gecerligun = $row['gecerli_gun'];
if ($gecerliyil > 0){
$date1=date_create(date("d-m-Y"));
date_add($date1,date_interval_create_from_date_string($gecerligun . " days"));
$result_str = $date1->format('d-m-Y');
$data["expiry_date"] = $result_str;
$date1=date_create(date("d-m-Y"));
I try to change this code but I couldn’t.