• How to store link to more than one image?

    From ^Bart@gabriele1NOSPAM@hotmail.com to comp.databases.mysql on Wed Oct 30 20:51:21 2019
    From Newsgroup: comp.databases.mysql

    Hi guys,

    I'd like to know your opinion about how to store in a MySQL db a link to
    some user's images!

    I thought to create a VARCHAR field where I could save a link to the
    user's private area, I don't like to use LONGBLOB...

    Regards.
    ^Bart
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Jerry Stuckle@jstucklex@attglobal.net to comp.databases.mysql on Wed Oct 30 16:49:51 2019
    From Newsgroup: comp.databases.mysql

    On 10/30/2019 3:51 PM, ^Bart wrote:
    Hi guys,

    I'd like to know your opinion about how to store in a MySQL db a link to some user's images!

    I thought to create a VARCHAR field where I could save a link to the
    user's private area, I don't like to use LONGBLOB...

    Regards.
    ^Bart

    There is nothing wrong with BLOBs - long or otherwise.

    You can create a VARCHAR field which points at a file (which would work,
    if you insist) but then you have a potential problem with data
    integrity. What happens if, for instance, the user deletes or even
    renames the file? Your link is now invalid. That doesn't happen with
    BLOB fields.
    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    jstucklex@attglobal.net
    ==================
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From ^Bart@gabriele1NOSPAM@hotmail.com to comp.databases.mysql on Thu Oct 31 20:41:23 2019
    From Newsgroup: comp.databases.mysql

    There is nothing wrong with BLOBs - long or otherwise.

    I don't like to use the DB for something which is not necessary! :D

    I think it's crazy to store images inside a db, if you do it your db
    will be very very very big and its speed will going down quickly!

    You can create a VARCHAR field which points at a file (which would work,
    if you insist) but then you have a potential problem with data
    integrity. What happens if, for instance, the user deletes or even
    renames the file?a Your link is now invalid.a That doesn't happen with
    BLOB fields.


    I think to create a link to the user's directory where the user can
    upload his images, by php you can show all images in a directory! :)

    Regards.
    ^Bart
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.databases.mysql on Fri Nov 1 08:09:35 2019
    From Newsgroup: comp.databases.mysql

    On 31/10/2019 19:41, ^Bart wrote:
    There is nothing wrong with BLOBs - long or otherwise.

    I don't like to use the DB for something which is not necessary! :D

    I think it's crazy to store images inside a db, if you do it your db
    will be very very very big

    So what? It would be just as big to store images anywhere else.

    and its speed will going down quickly!


    No, thats what indices are for.
    --
    Ideas are more powerful than guns. We would not let our enemies have
    guns, why should we let them have ideas?

    Josef Stalin
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Jerry Stuckle@jstucklex@attglobal.net to comp.databases.mysql on Fri Nov 1 12:19:26 2019
    From Newsgroup: comp.databases.mysql

    On 10/31/2019 3:41 PM, ^Bart wrote:
    There is nothing wrong with BLOBs - long or otherwise.

    I don't like to use the DB for something which is not necessary! :D

    I think it's crazy to store images inside a db, if you do it your db
    will be very very very big and its speed will going down quickly!


    It doesn't slow the database down significantly - and less than having
    to fetch a file name then fetch the file itself. Storing images in the database is a quite effective way of keeping the images with the data.

    Consider this - a file system is just another form of a database.
    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    jstucklex@attglobal.net
    ==================
    --- Synchronet 3.21d-Linux NewsLink 1.2