Get uploaded picture from mysql 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: Get uploaded picture from mysql database (/showthread.php?tid=55148) Pages:
1
2
|
Get uploaded picture from mysql database - El Forum - 10-12-2012 [eluser]rochellecanale[/eluser] hello guys i need a help regarding of getting the picture from my database literally the file path. My problem is after u run the query. It will continue to load and view nothing just keep on loading. Here's my code below hope you can help me. Code: $username = $this->session->userdata('username'); Here's the sample output from my database: Code: +-----------------------------------------+ When i attempt to run in sql like this: Code: mysql> SELECT file_path FROM upload WHERE username = 'ssssssssssss'; It display a path but when i load it in my php code it shows nothing. Get uploaded picture from mysql database - El Forum - 10-12-2012 [eluser]LuckyFella73[/eluser] DB queries goes into models and echo image tags into views but basically you can do your query like that: Code: $this->load->library->('database'); Get uploaded picture from mysql database - El Forum - 10-15-2012 [eluser]rochellecanale[/eluser] Its not showing any images. I tried also displaying of the full_path from my database but it loads only. I dont know my exact problem. Get uploaded picture from mysql database - El Forum - 10-15-2012 [eluser]LuckyFella73[/eluser] Quote:+-----------------------------------------+ Does your browser display the image when you paste the url directly into url field? Get uploaded picture from mysql database - El Forum - 10-15-2012 [eluser]rochellecanale[/eluser] I tried to create a simple image tag like this. Code: <img src='http://localhost/eMLM/upload/Sunset.jpg' height='100' width='100'> And it displays the image from my folder. But when i attempt to pull down the data from my mysql database it does not show. It keeps on loading. Get uploaded picture from mysql database - El Forum - 10-15-2012 [eluser]rochellecanale[/eluser] By the way if i attempt to run it in my url id displays Code: Object not found! Get uploaded picture from mysql database - El Forum - 10-15-2012 [eluser]LuckyFella73[/eluser] What do you get if you debug like: Code: $this->load->library->('database'); Get uploaded picture from mysql database - El Forum - 10-15-2012 [eluser]rochellecanale[/eluser] Hmm i didn't try that wait. Get uploaded picture from mysql database - El Forum - 10-15-2012 [eluser]rochellecanale[/eluser] Ok nothing displays it load again. It does not shows the path. Get uploaded picture from mysql database - El Forum - 10-15-2012 [eluser]LuckyFella73[/eluser] Seems you have to set up your htaccess the right way first? The error you posted is not related to your database call. Looks like your controller isn't called correctly. |