This topic is locked
[SOLVED]

custom button in server code

4/10/2024 1:17:46 PM
PHPRunner General questions
R
rkn2003 author

hi , anyone please help me, i;m newbie.
i have custom button and i write in server this code:

$sql = "UPDATE quo SET total =(SELECT sum(harga_total_enduser) FROM quo_detail where concat_quo=".$record["concat_quo"].") where concat_quo=".$record["concat_quo"];
DB::Exec($sql);

note concat quo is varchar.
any suggestion to write the right code for .$record["concat_quo"] ?

fhumanes 4/10/2024

Hi,
Test this code:

$concat_quo = $record["concat_quo"];
$sql = "UPDATE quo
SET total = (SELECT sum(harga_total_enduser) FROM quo_detail where concat_quo = '$concat_quo' )
where concat_quo= '$concat_quo' ";
DB::Exec($sql);

Regards,
fernando

R
rkn2003 author 4/11/2024

Thank you Mr. Fernando.
It's work