Welcome Guest, Not a member yet? Register   Sign In
How do you loop an upload data to a table without entering empty fields?
#2

[eluser]dallen33[/eluser]
I figured it out:
Code:
for ($i = 1; $i <= 10; $i++)
                    {
                        $field_name = 'file'.$i;
                        $this->upload->do_upload($field_name);
                        $data = array('upload_data' => $this->upload->data());
                        if ($_FILES['file'.$i]['error']  == UPLOAD_ERR_OK)
                        {
                            $this->booking->attachments($attach_id, $data['upload_data']['file_name'], $data['upload_data']['file_type'], $data['upload_data']['file_size']);
                        }
                        else
                        {

                        }
                    }

If there's a better way of doing this, let me know. But seems to work just fine!


Messages In This Thread
How do you loop an upload data to a table without entering empty fields? - by El Forum - 05-11-2009, 11:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB