Results 1 to 5 of 5

Thread: *SOLVED* - How to use a BLOB with PHP and MySQL

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    42

    *SOLVED* - How to use a BLOB with PHP and MySQL

    Hello all,

    I would like to store a binary file (for example
    a GIF file) in a MySQL database (BLOB field).

    How can I get a file in MySQL with PHP and
    how can I get it out again without altering
    the file?

    Any help is greatly appreciated.
    Last edited by hdvb; Jun 7th, 2002 at 02:09 AM.
    Greetings,

    Hajo Dijkstra


  2. #2
    scoutt
    Guest
    personally I would store the image in a directory and then the path in mysql.

    let me check on this as I have never done it. I would think it is the same as anything else, but let me check

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I have seen a tutorial on how to do this somewhere before, but I can't seem to find it now. I'll keep looking.

    However, I do agree with scoutt that I'd put it in a directory somewhere and then possibly store the location of it in a database instead.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  4. #4

    Thread Starter
    Member
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    42

    Thanks

    Thank you both (scoutt and The Hobo) for the
    reactions, however I found two articles on
    www.phpbuilder.com which explained how to
    use the blob field.

    Scoutt, about your remark about storing just the
    path to the image in a database, you might be
    right. However, the GIF was just a sample. More
    likely I will store other types of files in my DB,
    files that may not be linked to directly from other
    sites and so.

    Anyway, thanks again.
    Greetings,

    Hajo Dijkstra


  5. #5
    scoutt
    Guest
    I was just going to say that there is tutorials on phpbuilder to look at. although my suggestion was just that, a suggestion, you have to make the choice. but I will say that when you start ading pictures or other stuff in the blob field, you database will be getting big fast. jsut a side note if you interested.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width