Old 07-19-2005   #1 (permalink)
get nasty!
 
Uncle Ghed's Avatar
 
Join Date: Jun 2005
Location: Rome, Italy
Posts: 82

Send a message via MSN to Uncle Ghed
Putting images in MySql

I've got myself to the point where i have a table with all the fields I need (id, title, content, date, category Id).
I heard you can put images directly into a Mysql db. This means I need a new field, i think... Anyone can point out a tutorial for this?
(I believe i recall the images with the mysql_fetch_object function, and can format them in my display page...)
__________________
some day I'll understand why on earth I started drawing...
Uncle Ghed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-19-2005   #2 (permalink)
Mm.. axes.
 
Ripper's Avatar
 
Join Date: Jun 2005
Location: Finland
Posts: 46

This link helped me with the same issue: http://www.devarticles.com/c/a/MySQL...PHP-and-MySQL/
Hopefully you'll find it useful too.
__________________
- Rip
Ripper is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-19-2005   #3 (permalink)
Invicible Snake
 
ParaSnake's Avatar
 
Join Date: Sep 2004
Location: Ho Chi Minh City,Vietnam
Posts: 668

Send a message via MSN to ParaSnake Send a message via Yahoo to ParaSnake
This is as easy as puttng a text in MySQL
PHP Code:
$img "<img scr = 'path'>";
mysql_query("INSERT INTO tbl(img_field) VALUES('".$img."') "); 
Output it:
PHP Code:
//connect to db
$query mysql_query("SELECT * FROM tbl");
while(
$a mysql_fetch_assoc($query) {
          
$img_path $a['img'];
          echo 
$img."<BR>";

Hope this is what you are looking for.
__________________
ParaSnake is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-19-2005   #4 (permalink)
get nasty!
 
Uncle Ghed's Avatar
 
Join Date: Jun 2005
Location: Rome, Italy
Posts: 82

Send a message via MSN to Uncle Ghed
Both of you have helped a lot!! Thanks! ^^
Uncle Ghed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-20-2005   #5 (permalink)
Invicible Snake
 
ParaSnake's Avatar
 
Join Date: Sep 2004
Location: Ho Chi Minh City,Vietnam
Posts: 668

Send a message via MSN to ParaSnake Send a message via Yahoo to ParaSnake
nah,not me,i read the articles on devshed and i realized that i dint got what u mean corectly,sorry
__________________
ParaSnake is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-21-2005   #6 (permalink)
get nasty!
 
Uncle Ghed's Avatar
 
Join Date: Jun 2005
Location: Rome, Italy
Posts: 82

Send a message via MSN to Uncle Ghed
As a matter of fact....
What I'm trying to do is a table that has an Id, a few other fields and a blob field, containing the image. This way when I call my row my Image is associated via database to my other fields, containing a title, a news, a date, etc...
Now: how the heck do I display this image? do I need an extra field called, uhm, "nameImage" or something? or do I just display it with the $fileType $fileContent variables?
I'm getting pretty messed up...
__________________
some day I'll understand why on earth I started drawing...
Uncle Ghed is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 07-21-2005   #7 (permalink)
code anyone?
 
scrowler's Avatar
 
Join Date: Feb 2004
Location: New Zealand
Posts: 590

Send a message via MSN to scrowler Send a message via Skype™ to scrowler
if you wanna keep the original image name, then yes you need another column. basically do this:

get data from database
set header type to image : header("Content-type: image/jpeg"); etc
echo the data
__________________
BioRUST Tutorials - the birthplace
scrowler is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
flash and mysql ahmedtheking Flash & Dynamic Media 12 08-11-2004 06:15 PM
Help: Making images links (it isn't what you think...read) kp606-Epsilon Adobe Photoshop 2 07-15-2004 02:14 PM
blending two external images into each other LimitLess Flash & Dynamic Media 20 07-04-2004 07:53 PM


All times are GMT +1. The time now is 09:47 AM.
Content Relevant URLs by vBSEO 3.2.0

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT