Welcome Guest, Not a member yet? Register   Sign In
Multiple File Upload with SWFUpload

Im needing abit of help... Im trying to figure out how I can add a record to the database and then pass the id of that record across to the upload... when the upload is complete it should insert the information into the database with the 'vid' being the record...

Sorry if that doesnt make sense lol its 6am here with no sleep...

Basically Im adding a vehicle into a database, once its confirmed it will give the user the option of uploading upto 10 photos. Once they are uploaded it should add the information into the database putting the vehicle id into the vid field so that on the view page it can call the images relating to the vehicle.

Hoping someone can help me here.


There are two parts to this - the upload confirmation, and the insert confirmation.

I don't know how much you have, but for future readers:

function insert_item(){
        if ($this->input->post('image') ==''){
            $file_name = do_upload('./images/items/');
            $_POST['image'] = $file_name;
                $id = $this->db->insert_id();
// error check on your $id that it returned a valid value
// if it did, go do your next bit


Will give some basic uploading code


Hope that helps you get started.

(Also - no point working when you are that tired - rested coding is 12.43 times faster and more bug free than all-nighter code. Go sleep. )

Theme © iAndrew 2016 - Forum software by © MyBB