I am trying to do an UPDATE statement for multiple records for the edit function. The page has multiple rows that requires to be updated. I am not sure how to construct the statement if the parameter passed is an array.
arr_items[[arr_items2]] </br>
arr_items[[value1, value2, value3, value4], [value1, value2, value3, value4]]
I tried different bind_param also but it won't work.
edit-view.php
$dao5->modify($arr_items)
DAO.php
public function modify($arr_items) {
$sql = 'update table set
column3=:???(supposedly value3)
column4=:???(supposedly value4)
where column1=:???(supposedly value1) and column2=:???(supposedly value2);
$values = $arr_items;
for ($i=0; $i < count($values); $i++){
$stmt = $conn->prepare($sql);
}
$connMgr = new ConnectionManager();
$conn = $connMgr->getConnection();
call_user_func_array(array($stmt, 'bind_param'), $values);
$stmt->execute();
}
Error Message: ``` Uncaught Error: Call to a member function prepare() on null in C: