Welcome Guest, Not a member yet? Register   Sign In
image upload with save its name in db
#2

[eluser]LuckyFella73[/eluser]
Take the code from the user guide ("Creating the Upload Form" , "The Success Page" and "The Controller"):
http://ellislab.com/codeigniter/user-gui...ading.html

Then in the controller code:

Code:
<?php
// change this:
$data = array('upload_data' => $this->upload->data());

// to
$upload_data = $this->upload->data();
$db_data = array(
'filename' => $upload_data['file_name']
);
$this->db->insert('mytable', $db_data); // replace the tablename
?>

Thats basically what you need (the simplest version)

Be sure you have a database table having a column called 'filename'
and read the whole provided page (userguide) to understand what parameters
you might have to adjust (i.e. upload path ...)



EDIT:

Why did you opened a new thread with the same question you allready posted and
where other members allready started to help you? You just wasted my time


Messages In This Thread
image upload with save its name in db - by El Forum - 03-21-2012, 05:39 AM
image upload with save its name in db - by El Forum - 03-21-2012, 07:33 AM
image upload with save its name in db - by El Forum - 03-21-2012, 08:36 AM
image upload with save its name in db - by El Forum - 03-21-2012, 08:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB