943,514 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 2926
  • PHP RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Sep 10th, 2008
0

Re: Pulling images from database

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 ...
php Syntax (Toggle Plain Text)
  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.
Reputation Points: 30
Solved Threads: 36
Posting Whiz
langsor is offline Offline
389 posts
since Aug 2008
Sep 15th, 2008
0

Re: Pulling images from database

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!
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
mgn2683 is offline Offline
63 posts
since Dec 2007
Sep 15th, 2008
0

Re: Pulling images from database

Click to Expand / Collapse  Quote originally posted by mgn2683 ...
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.
Reputation Points: 14
Solved Threads: 8
Junior Poster
antwan1986 is offline Offline
110 posts
since May 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Upload image folder
Next Thread in PHP Forum Timeline: Showing a list from MySQL using WHERE isnt working :(





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC