Page 1 of 1

HOW Mysql.......PHP

Posted: Wed May 12, 2004 10:04 am
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...

Posted: Wed May 12, 2004 10:08 am
by Weirdan

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

Posted: Wed May 12, 2004 10:10 am
by pernks
THANKS FOR YOUR HELP

Posted: Wed May 12, 2004 10:11 am
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">

Posted: Wed May 12, 2004 10:15 am
by Weirdan
malcom, you can store images in db. Usually it's unnecessary, but for certain tasks it might be useful.

Posted: Wed May 12, 2004 10:19 am
by launchcode
Yeah you can (lovely blob fields) but it's 99% of the time a waste of resources :)

Posted: Thu May 13, 2004 3:09 am
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