Currently, I have this php code where the "//add data to paid table" executes successfully.
(and successfully adds the '$site_add_amount' into the 'site_amount' table column):
$site_add_amount = $video_cost_new *0.50;
// add data to paid table
$insert_buy = $db->insert('paid_videos', [
'id_user' => $user_id,
'video_play_price' => (string)$video_cost_new,
'id_video' => $video_id,
'site_amount' => $site_add_amount,
'time' => $time_start
However, I'm trying to get 'site_add_amount' to be totaled/grouped in the db, each time the code is executed, so it shows a continuous total, of every 'site_amount'. (Also, I have a field in the db table named: 'site_total').
any suggestions/guidance/help is appreciated