Pulling images from database

Thread Solved

Join Date: Aug 2008
Posts: 381
Reputation: langsor is an unknown quantity at this point 
Solved Threads: 33
langsor langsor is offline Offline
Posting Whiz

Re: Pulling images from database

 
0
  #11
Sep 10th, 2008
Hi,

For debugging purposes I would do something like what Anthony is suggesting.

I would locate an image in the images directory, say G493075_101_12.jpg, and find it's database ID ... then in a simplified PHP script (in the same directory as the one you are working on), I would write the image tag statically and also immediately following I would call just that image from the database ...
  1. $static = "website.com/images/main/G493075_101_12.jpg";
  2. $dbase = $row_rs_listings['img_main']; // use actual specific DB call for that image ...
  3.  
  4. print "<img src=\"$static\" />";
  5. print "<img src=\"$dbase\" />";

Here see if either show up, if the static one shows but the DB one does not then look at the source of the resultant page and see what the image-source is that is different from the static one. Possibly you are not getting results from your DB query. If neither images shows then ... then check back here and let us know what you did show up.

We're trying to find where the code is breaking, is it the database not producing results, is it the path to the image in the image directory somehow getting corrupted so it doesn't actually point to an image, is there something else going on ... we need information to figure this out.
Google is the answer to all of your questions -- the trick is knowing what question to ask in your specific predicament.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 52
Reputation: mgn2683 is an unknown quantity at this point 
Solved Threads: 0
mgn2683's Avatar
mgn2683 mgn2683 is offline Offline
Junior Poster in Training

Re: Pulling images from database

 
0
  #12
Sep 15th, 2008
Finally, I realized what I had wrong: in the database, I was missing one folder for the path:

website.com/images/main/imagename.jpg

Thanks to everyone who helped me with this, I really appreciate it!
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 110
Reputation: antwan1986 is an unknown quantity at this point 
Solved Threads: 8
antwan1986's Avatar
antwan1986 antwan1986 is offline Offline
Junior Poster

Re: Pulling images from database

 
0
  #13
Sep 15th, 2008
Originally Posted by mgn2683 View Post
Finally, I realized what I had wrong: in the database, I was missing one folder for the path:

website.com/images/main/imagename.jpg

Thanks to everyone who helped me with this, I really appreciate it!
It's always something simple isn't it? Glad you got sorted.
"Beneath this mask there is more than flesh. Beneath this mask there is an idea, Mr. Creedy, and ideas are bulletproof." - V
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC