PDA

View Full Version : Mysql + link to picture in a folder from php document


trainer2006
05-13-2006, 08:50 PM
Hey Guys... :D - newbie!!!

im building a new website and I would like to link to a picture from my mysql database or a php document , I keep my pictures in a folder.


for example... I have a index.php with some text from the database - then a picture linked from the folder (where should it be linked from??? ) - then some more text from the database.


what is the correct thing to do??? syntax please...


trainer :wink:

boxslayer
05-14-2006, 04:04 AM
im wondering the same exact thing

im referencing the database correctly from dreamweaver because when i hit test or preview it shows the TEXT from my database that im trying to reference.

when i check it on the internet, it shows the borken link image with the red "x".

not sure if my database should be text or varchar or blob or what. im trying to reference my image in it's folder from the database.

root: www/images/logo_main.gif

i've tried typing in the database field

"logo_main.gif"
"images/logo_main.gif"
"www/logo_main.gif"

it just wont reference...im screwing something dumb up.

boxslayer
05-15-2006, 01:20 AM
got it...

checklist

1) case sensitive!!!!!
2) use ../ to go back a folder...make sure you are referencing the right folder
3) datbase field should be set to TEXT...wont work in varchar

trainer2006
05-18-2006, 10:22 PM
Can anyone show us the syntax??? 8)

edbr
05-19-2006, 07:02 AM
images/logo_main.gif I would think

trainer2006
05-19-2006, 07:55 AM
ok thanks... this worx "img/bee.jpg"


trainer