Jump to content

Archived

This topic is now archived and is closed to further replies.

Drumlegend

storing and displaying image from database via filepath

Recommended Posts

1. Are you sure your query is working?  Have you run it in phpMyAdmin?

2. Have you simply tried (with the code above)

echo "<img src=\"{$recipe['image']}\" /><br />";

??

The code you posted worked, I just needed to remove public_html from that path that was suggested. Thank you man!

Share this post


Link to post
Share on other sites

Seriously?

 

So on my machine, the full path of an image is C:\wamp\www\project\web\images\image.png.

 

My "web root" or the equivalent of public_html is C:\wamp\www\project\web

 

Are you trying to argue that the image url should be: C:\wamp\www\project\web\images\image.png and not images/image.png? Because if so my computer and every other one I've ever developed on must be special.

 

Yes, that's correct that an absolute path to the image onto the machine is "C:\wamp\www\project\web\images\image.png", but it's also true that an absolute path to this image onto the web server is "/images/image.png" , not "images/image.png" (it's a relative path) 

So, when we're starting to reach something with "/" that tells to the server that we're going to use an absolute path to this element.

Share this post


Link to post
Share on other sites

Jazzman. That is WHAT I SAID.

 

That was my point. Thanks for making it over and over again.

Share this post


Link to post
Share on other sites

Ah....so sorry if I was misread your threads by saying:

 

If you want to store an image path to display the image in HTML, that IS the path you want.

 

 

PS. By the way, you are not rude and an arrogant girl ;)

Share this post


Link to post
Share on other sites

Ah....so sorry if I was misread your threads by saying:

 

 

PS. By the way, you are not rude and an arrogant girl ;)

Sure I am, I just don't care if anyone else thinks so :-P

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.