PHP + MySql + blob for storing a pic.

Sharky Forums


Results 1 to 3 of 3

Thread: PHP + MySql + blob for storing a pic.

  1. #1
    Catfish
    Join Date
    Sep 2000
    Location
    Wales, UK
    Posts
    140

    Post PHP + MySql + blob for storing a pic.

    Hiya all,

    How would i go about doing this, i want to store a picture in a MySql database. How would i go about doing that?

    Would i use a blob? If so, how do i get the picture onto the database?

    Then using PHP, what would i do to output that picture to the screen?

    Cheers all
    Jon

  2. #2
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077

    Post

    Hmmm, I'm not sure about blobs, but what's wrong with uploading the file, and storing the system path in the DB? That's usually the route I've taken when storing pics in a DB. Kind of like the theory behind pointers in C...why store the actual data, when all you really need is a pointer to that data?

  3. #3
    Ultra Great White Shark!! richardginn's Avatar
    Join Date
    Feb 2001
    Posts
    16,118

    Post

    Originally posted by Grizzly:
    Hmmm, I'm not sure about blobs, but what's wrong with uploading the file, and storing the system path in the DB? That's usually the route I've taken when storing pics in a DB. Kind of like the theory behind pointers in C...why store the actual data, when all you really need is a pointer to that data?
    yeah, great point.



    ------------------
    www.geocities.com/richardginn/templatehtml -Come visit the Template HTML homepage
    www.myeducational plan.com-come see my plan to fix the USA educational system. I hope this is sig legal. Major Site Design Update on July 18, 2006. On June 18, 2009 passed the 10,000 post mark. December 24, 2009: Major Theme change and more....

Posting Permissions

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