Hello David,

Thursday, May 20, 2004, 2:21:37 AM, you wrote:

DB> --- Hassan Schroeder <[EMAIL PROTECTED]> wrote:

>> Actually, if you include the dimensions in your
>> image *names* --
>> which is a great timesaver -- you can store them as,
>> say
>> 
>>    ak.200x150.gif
>> 
>> and retrieve as
>> 
>>    SELECT
>>        img
>>      , SUBSTRING(img,4,3) AS width
>>      , SUBSTRING(img,8,3) AS height
>>    FROM
>>      images
>>    WHERE
>>      LEFT(img,2) = 'ak'
>> 
>> You can put that into your own function and write
>> the entire image
>> tag out with the proper width and height, in one
>> swell foop :-)

DB> * * * * * * * * * *

DB> It will take me a while to understand this, as I
DB> haven't even begun to learn about strings, let alone
DB> substrings, yet.

DB> But I have a couple questions, for future reference:

DB> 1. When you talk about including dimensions in image
DB> names, do you mean it literally? For example, if I
DB> create an image in photoshop that measures 150px X
DB> 125px, I could save it as horse.jpg, or save it as
DB> horse.150X125.jpg?

DB> 2. Are you talking about storing the actula image in
DB> MySQL (as a BLOB), or just placing links to image
DB> names (that include dimensions) in a field?...

DB> ak.200x150.gif
DB> wy.225X110.jpg


php + mysql

1 define path to store files in conf file
2 upload there with unique name (use php uniqueid)
3 to show image use php getimagesize to get width, height and image
type (even for swf)

that's the way

only minus is more work to backup/copy database with images









-- 
Best regards,
 artem                            mailto:[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to