Whenever i tried to update the form using following code, the update goes silent with the 0 value in title field and previous value in content field. Can someone please help!!!
adminClass.php
update function
if( $form_title && $form_content ){
$sql = "UPDATE home_page
SET title = '{$form_title}' AND content = '{$form_content}' WHERE id = {$id}";
echo $sql;
$result = $this->mysqli->query( $sql );
if(!$result){
echo 'Error'. mysqli_error();
return;
}else{
$this->success_message = "Update Successfull";
return;
}
}
admin.php view page
if( isset( $_POST['update'] ) ){
$admin_obj->update($_POST, $id);
}