CodeIgniter Forums
Uploading image name to the database - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Uploading image name to the database (/showthread.php?tid=24610)



Uploading image name to the database - El Forum - 11-14-2009

[eluser]Unknown[/eluser]
hi i am new the CI , i have successfully uploaded the file to the server but in order to retrieve the image must put in database.

can anyone help me of this

i have done like this

$upload_data = $this->upload->data();
$filename = $upload_data['file_name'];

$this->load->model('register');
if($query = $this->register->registration($filename))
{
echo 'inserted';
}
else
{
echo 'error';
}
from here how can i insert into the model ,anyone please help for me...


Uploading image name to the database - El Forum - 11-14-2009

[eluser]saidai jagan[/eluser]
If the upload in success and the query returns the last insert id.
Then u r code is correct.


Uploading image name to the database - El Forum - 11-15-2009

[eluser]Tandubhai[/eluser]
You are already done.....
:-) Tandubhai