4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 How do I insert images to mysql database?
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
rippleffect
Junior WebHelper
Junior WebHelper


Joined: 13 Nov 2003
Posts: 10

PostPosted: Thu Nov 13, 2003 8:40 pm (20 years, 5 months ago) Reply with QuoteBack to Top

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...
OfflineView User's ProfileFind all posts by rippleffectSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Thu Nov 13, 2003 9:13 pm (20 years, 5 months ago) Reply with QuoteBack to Top

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...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
rippleffect
Junior WebHelper
Junior WebHelper


Joined: 13 Nov 2003
Posts: 10

PostPosted: Thu Nov 13, 2003 9:46 pm (20 years, 5 months ago) Reply with QuoteBack to Top

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?
OfflineView User's ProfileFind all posts by rippleffectSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Thu Nov 13, 2003 9:52 pm (20 years, 5 months ago) Reply with QuoteBack to Top

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...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




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.205264 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme