Can somebody tell me why my update did not work ?
Here are the data in my variable $id = '1'; $table = 'tb_home_content'; $data = Array ( [title] => SLEEK DESIGN [content] => We have a sleek design which not only attractive but simple in design for our user to see. [classicon] => fa fa-clone );
Here are my model function
public function updateData($table, $data)
{
$id = $data['id'];
array_shift($data);
// echo $id.'<br>';
// echo $table.'<br>';
// print_r($data);
$this->db->where('id', $id);
$this->db->update($table, $data);
if($this->db->affected_rows() == '1')
{
echo "<script>";
echo "alert('Success');";
echo "</script>";
}
else
{
echo "<script>";
echo "alert('Failed');";
echo "</script>";
}