HOW Mysql.......PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pernks
Forum Newbie
Posts: 10
Joined: Wed May 12, 2004 10:03 am

HOW Mysql.......PHP

Post by pernks »

How could I stored images into mysql......and view it using PHP code..what are the formats used or supported....thanks for ur HELP...
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

pernks
Forum Newbie
Posts: 10
Joined: Wed May 12, 2004 10:03 am

Re: HOW Mysql.......PHP

Post by pernks »

THANKS FOR YOUR HELP
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

you dont store the image, you store the href (path) to the image for eg

Code: Select all

// pseudo
$array = myqsl_fetch_array($result, MYSQL_ASSOC);
then in your HTML page to display it

Code: Select all

<img src = "<?php print $array['image'] ?>" alt = "This is a picture">
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

malcom, you can store images in db. Usually it's unnecessary, but for certain tasks it might be useful.
User avatar
launchcode
Forum Contributor
Posts: 401
Joined: Tue May 11, 2004 7:32 pm
Location: UK
Contact:

Post by launchcode »

Yeah you can (lovely blob fields) but it's 99% of the time a waste of resources :)
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

launchcode wrote:Yeah you can (lovely blob fields) but it's 99% of the time a waste of resources :)
launchcode couldnt of said it better
Post Reply