public function updateDevMode(){
$devices_dep = "YOUR_TABLE_NAME";
$device_mode=htmlspecialchars(strip_tags($this->device_mode));
$id=htmlspecialchars(strip_tags($this->id));
$sqlQuery = "UPDATE $devices_dep SET device_mode=$device_mode WHERE id=$id";
$this->db->query($sqlQuery);
if($this->db->affected_rows > 0){
return true;
}
return false;
}
select
t1.AUTHOR,
t1.total
from
(
SELECT AUTHOR, count(*) as total
FROM POSSESSION
INNER JOIN BOOKS ON BOOK_ID = BOOKS.ID
WHERE TAKING_DATE > (CURRENT_DATE - INTERVAL '1 year')
GROUP BY AUTHOR
) t1
where t1.total =
(
select
max(t2.total)
from
(
SELECT AUTHOR, count(*) as total
FROM POSSESSION
INNER JOIN BOOKS ON BOOK_ID = BOOKS.ID
WHERE TAKING_DATE > (CURRENT_DATE - INTERVAL '1 year')
GROUP BY AUTHOR
) t2
)
INSERT INTO `product_comments` (`product_slug`, `product_id`, `user_id`, `created_at`, `updated_at`, `content`) VALUES ('крем-для-рук-и-ногтей',1,2,'2019-04-08 13:25:31.000000','2019-04-08 13:25:31.000000','Крем вообще супер.')