SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Jun 28, 2000, 23:47 #1
- Join Date
- Jun 2000
- Location
- Netherlands
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
In the mysql/php tutorials (which are great) only text/numeric entries are covered (id's , the jokes, names etc.). But what if you want to get an article from the database which includes an image? Is it possible to to get both the text and (the link to) the image from the database?
-
Jun 29, 2000, 02:51 #2
- Join Date
- Aug 1999
- Location
- Pittsburgh, PA, USA
- Posts
- 3,910
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
networktm: I believe plain HTML can be entered into an SQL table...so you could just stick the image code in there and try to pull it out of the database...
------------------
Chris Bowyer
MyCoding.com: Join our mailing list for launch notification!
"I'm not an insomniac, I'm a web designer."
-
Jun 29, 2000, 04:34 #3
- Join Date
- Jun 2000
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Well, if you have a standard image directory and put the filename in the db, it's pretty simple to put it in.
<img src="path/to/<?php printf($filename); ?>">
Of course it assumes that you pulled the filename from the db and assigned it to $filename.
-
Jun 29, 2000, 12:01 #4
- Join Date
- Jul 1999
- Location
- Chicago
- Posts
- 2,629
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
jwynia's way is the best but images and other binary data can be stored in DBs too. Just use BLOB to store the data. Like...
CREATE TABLE images (
//stuff...
IMAGEDATA BLOB,
);
-
Jun 29, 2000, 20:24 #5
- Join Date
- Apr 2000
- Location
- Melbourne, Australia
- Posts
- 2,571
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
Hopefully I'll have time to cover storing binary data in a MySQL database and displaying it as an image in an HTML page. If I don't, I'll be sure to post a link to the information somewhere on the Net.
------------------
-Kevin Yank.
http://www.SitePoint.com/
Helping Small Business Grow Online!
-
Jun 30, 2000, 04:11 #6
- Join Date
- Jun 2000
- Location
- Netherlands
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thank you all for helping me.
Bookmarks