How do i insert a uploaded image's path 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: How do i insert a uploaded image's path to the database? (/showthread.php?tid=43526) |
How do i insert a uploaded image's path to the database? - El Forum - 07-14-2011 [eluser]maxrosecollins[/eluser] Hi, I can upload an image to my site but i am having real trouble getting the path of the image into my database...? this is my controller Code: <?php and my model... Code: <?php and my view Code: <?php echo $error;?> and the other view. which manages to show the path of the image i just can't understand why it wont let me insert it into the database!?!?!? Code: <div id="container"> can anyone help me please? it would be greatly appreciated Thanks Max How do i insert a uploaded image's path to the database? - El Forum - 07-14-2011 [eluser]jmadsen[/eluser] You don't have $data['full_path'] as part of your insert statement anywhere. The file loading will take care of itself, but if you want its info stored in the db, you need to pass it there How do i insert a uploaded image's path to the database? - El Forum - 07-16-2011 [eluser]maxrosecollins[/eluser] isn't Code: 'images'=>$data['full_path'], all i need to put?! How do i insert a uploaded image's path to the database? - El Forum - 07-16-2011 [eluser]jmadsen[/eluser] Ah, I missed that, sorry. Then use the standard debugging techniques and see where it is going wrong. you can start with: Code: $this->db->last_query() to see what your insert statement looks like, and if the value is there. Also, share any error messages. "can't get it into the database" is rather vague for us to try to help you. could be your table schema, for example How do i insert a uploaded image's path to the database? - El Forum - 07-16-2011 [eluser]fraserk[/eluser] how about this.. Code: $results = $this->upload->data(); Then Code: 'images'=> $results['file_name'] |