I am getting the below error in the laravel controller when I update 4 columns with comma-separated values without quotes which are coming from the request
Request payload:
column1 : one,two,three
column2 : six,seven
column3 : eight,nine
<?PHP
function run(Request $request){
$column1 = $request->get('column1');
$column2 = $request->get('column2');
$column3 = $request->get('column3');
$save = DB::table('tableone')->where('primaryclm', '1')->update(['column1' => $column1,'column2' => $column2,'column3' => $column3]);
}
?>
Error:
SQL error (SQL: update `tableone` set `column1` = one,two,three
,`column2` = four,five,six
,`column3` = seven,eight
where `primaryclm` = 1)
Kindly help with this issue.