Hello all members, I want to ask about PHP Native Sorry I'm new to PHP, I created an input form using Edit Text and Combobox But failed in saving the following is the code that I use
The problem is I can't get the id from the combobox and it always fails to save it, :(
function save_upload(){
extract($_POST);
// var_dump($_FILES);
$data = " title ='$title' ";
$data .= ", description ='".htmlentities(str_replace("'","’",$description))."' ";
$data .= ", user_id ='{$_SESSION['login_id']}' ";
$data .= ", file_json ='".json_encode($fname)."' ";
$data = " DocType_id ='$combodoctype' ";
$data = " Dept_ID ='$combo4' ";
if(empty($id)){
$save = $this->db->query("INSERT INTO documents set $data ");
}else{
$save = $this->db->query("UPDATE documents set $data where id = $id");
}
if($save){
return 1;
}
}
admin_class.txt
ajax.txt
newdocument.txt