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

[eluser]meer[/eluser]
can some one send me the simple demo example of uploading image with saving its name in database
plzzzzzz.......
i need a simple demo........its urgent for me to move forward
#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
#3

[eluser]meer[/eluser]
ooooooooooooooooooooooooo.

i did it myself....
thanks :-)
#4

[eluser]meer[/eluser]
thanks lucky.....
thanks alott




Theme © iAndrew 2016 - Forum software by © MyBB