i have below query and it work fine.
but if the $where were array it will be fail,what's the solution?
public function update($tbl_name, $data = NULL, $where = NULL)
{
if ($data) {
$data_key = array_keys($data);
$where_key = array_keys($where);
$query = "UPDATE " . $data['db_table'] . " SET ";
foreach ($data_key as $key) {
$query .= "`" . $key . "` = '" . $data[$key] . "' ";
}
//todo fix that for multi where
$query.=" WHERE `".$where."`=".$where[''];
return $this->query($query);
}
return false;
}
WHERE IN ( array elements )for filtering on multiple values. If the array elements are text, then you'll need to surround them in quotation marks. Regardless of the element type, you'll need a comma separator between values.$whereis an array of what thing? values? conditions? a pair of field-value? other?