save image path to database and then display it - 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: save image path to database and then display it (/showthread.php?tid=11594) |
save image path to database and then display it - El Forum - 09-15-2008 [eluser]Dan Tdr[/eluser] Hey.. i kind of have a problem.. i need some help in saveing the path of an uploaded image to a database.. and then display it from the database.. here is what i have for uploading the image: controller: Code: function do_upload() Code: <html> Code: <html> after i upload a file the upload_success pops up and it gives me some info: Code: <html> in this message it displays some things that i could use to put the path into the database.. i could only put the file name and extension into the database and then call if from the database i could do that with something like : Code: <?php could some one help me please? i`m sure it`s not that hard.. just that i don`t have the experience needed to see how to do it if someone could help i would be realy grateful thanks, Dan save image path to database and then display it - El Forum - 09-15-2008 [eluser]mdowns[/eluser] Could you be a little more specific as to what the problem is? save image path to database and then display it - El Forum - 09-15-2008 [eluser]Dan Tdr[/eluser] i don`t know how i could store the image name and extension into a database after i uploaded it on my server so that i could output it on a user profile save image path to database and then display it - El Forum - 09-15-2008 [eluser]mdowns[/eluser] First get the full path of the image you uploaded. Read more about the File Uploading Class in the user guide. Code: $filepath = $this->upload->data()['full_path']; Then insert that into your database. Hope that helps. |