|
Author |
Message |
rippleffect
Junior WebHelper
Joined: 13 Nov 2003
Posts: 10
|
Posted:
Thu Nov 13, 2003 8:40 pm (20 years, 6 months ago) |
|
Or something similar to this would be how do i make mysql point to certain folder for image files?
I am scratching my head over this one... |
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Thu Nov 13, 2003 9:13 pm (20 years, 6 months ago) |
|
the best way of doing this would really depend on what you're trying to achieve. Are you simply wanting to use the URL to some images in a HTML document? or are you trying to do something more complex? |
________________________________ It's turtles all the way down... |
|
|
|
rippleffect
Junior WebHelper
Joined: 13 Nov 2003
Posts: 10
|
Posted:
Thu Nov 13, 2003 9:46 pm (20 years, 6 months ago) |
|
Hi, Adam
I have a folder with all the icons. And also, when i input data into the database, I just insert the name of the image file. for example, "image.jpg" in table 'tbl_image'.
now, my .php file contains a script:
$image_path = "./graphics/";
$show_image = $row['tbl_image'];
but not quite sure how I need to script it so that the .php file looks into the folderpath and draws out the correct file and displays it.
at first, I was going to have SQL to contain the scripts but that looked too hard. I figured the best way to go about this would be using .php to do that. so would you help me out? |
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Thu Nov 13, 2003 9:52 pm (20 years, 6 months ago) |
|
ah, so you already have the path to the images and the names of the images? in that case, all you'll need to do is write something like:
Code: | print '<img src="'.$image_path.$show_image.'" />'; |
that should output something like:
Code: | <img src="./graphics/icon.gif" /> |
assuming "icon.gif" is stored in the database. |
________________________________ It's turtles all the way down... |
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.146958 seconds :: 13 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |