if($_FILES['test_image']['name']){
$query = "UPDATE $table SET `message`='{$_POST['test_mess']}' WHERE `id`='{$_POST['update']}'";
} else {
$query = "UPDATE $table SET `image`='{$_FILES['test_image']['name']}', `message='{$_POST['test_mess']}' WHERE `id`='{$_POST['update']}'";
}