<?php
$user_id=abs(intval($_SESSION['id']));
$row=$dbc->query("select * from  regeberation where id = '$user_id' limit 1")->fetch_assoc();
$query = "Select * from `regeneration` WHERE `user_id` = '$user_id'  LIMIT 1";
$for= mysqli_query($dbc, $query) or die ('Ошибка передачи запроса к БД');
$avto = mysqli_num_rows($for);
$time= time()+60;
if($avto==0){
$pdo->exec("INSERT INTO `regeneration` SET `user_id` = '$user_id', `time`='$time'");}
if($row[time]>time()){
$pdo->exec("UPDATE regeneration SET time = '$time'+'60' WHERE id = '$user_id'");
$pdo->exec("UPDATE users SET sutost =sutost-1' WHERE id = '$user_id'");
}
?>