public function update_weather($id, $data) { $i = 0; foreach($data as $name => $val): if ($i!=$len-1) { if ($i==$len-2) { $n .= $name.'=?'; $v .= $val; } else { $n .= $name.'=?,'; $v .= $val.","; } } $i++; endforeach; $this->activ = $this->pdo->prepare("UPDATE weather SET $n WHERE id=?"); } }
Błąd:
Invalid parameter number: number of bound variables does not match number of tokens' in ....
Ma ktoś pomysł?