Jump to content

[Newbie Ask] Combobox get value and save


masputhut

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.