Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. MySQL and Images [modified] - RESOLVED

MySQL and Images [modified] - RESOLVED

Scheduled Pinned Locked Moved Database
databasemysqlsql-serversysadminquestion
10 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mike L
    wrote on last edited by
    #1

    I'm generally familiar with SQL Server 2005 and I know there's an IMAGE data type that I can use to store pictures in the db. Can MySQL do the same? I'll be heading to the book store tomorrow to pick up a book and read up on this, but any experience in this area, particularly including taking pictures that are saved on my local disk and storing them in a web-based MySQL db would be greatly appreciated. I've seen sample apps for SQL Server 2005 that do this, but not MySQL and get the impression it's not nearly as easy, but probably possible. Thanks!!

    modified on Monday, December 24, 2007 10:29:00 PM

    P 1 Reply Last reply
    0
    • M Mike L

      I'm generally familiar with SQL Server 2005 and I know there's an IMAGE data type that I can use to store pictures in the db. Can MySQL do the same? I'll be heading to the book store tomorrow to pick up a book and read up on this, but any experience in this area, particularly including taking pictures that are saved on my local disk and storing them in a web-based MySQL db would be greatly appreciated. I've seen sample apps for SQL Server 2005 that do this, but not MySQL and get the impression it's not nearly as easy, but probably possible. Thanks!!

      modified on Monday, December 24, 2007 10:29:00 PM

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      Mike L. wrote:

      IMAGE data type that I can use to store pictures in the db. Can MySQL do the same?

      Yes. I think it is the blob datatype.

      "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

      M 1 Reply Last reply
      0
      • P Paul Conrad

        Mike L. wrote:

        IMAGE data type that I can use to store pictures in the db. Can MySQL do the same?

        Yes. I think it is the blob datatype.

        "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

        M Offline
        M Offline
        Mike L
        wrote on last edited by
        #3

        Thanks - I'll go get a book and see if I can find some examples.

        P 1 Reply Last reply
        0
        • M Mike L

          Thanks - I'll go get a book and see if I can find some examples.

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #4

          I have a sample around here somewheres. I'll try to find it.

          "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

          M 1 Reply Last reply
          0
          • P Paul Conrad

            I have a sample around here somewheres. I'll try to find it.

            "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

            M Offline
            M Offline
            Mike L
            wrote on last edited by
            #5

            Thanks Paul. I also have the ability to use Access, and have samples for storing & retrieving files from that. Any advantage to MySQL, since I don't have MySQL, but do have Access? i.e., it'll cost me some money to use MySQL, where I can use Access for free, and this is a personal web site for storing photo's, etc.

            P 1 Reply Last reply
            0
            • M Mike L

              Thanks Paul. I also have the ability to use Access, and have samples for storing & retrieving files from that. Any advantage to MySQL, since I don't have MySQL, but do have Access? i.e., it'll cost me some money to use MySQL, where I can use Access for free, and this is a personal web site for storing photo's, etc.

              P Offline
              P Offline
              Paul Conrad
              wrote on last edited by
              #6

              Go ahead and use Access. Shouldn't be any problems. Since you are going to be storing photos, the best approach with a database is to save just the path on the server to the photos rather than putting the photos in the database.

              "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

              M 1 Reply Last reply
              0
              • P Paul Conrad

                Go ahead and use Access. Shouldn't be any problems. Since you are going to be storing photos, the best approach with a database is to save just the path on the server to the photos rather than putting the photos in the database.

                "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                M Offline
                M Offline
                Mike L
                wrote on last edited by
                #7

                That would certainly make it easier, but won't having a database and an "add picture and keywords" type of functionality make it easier to store, retrieve, and catalog? I have literally thousands and thousands of travel photos from all over the world, and want to be able to give friends and family the ability to search by subject, then return those that match the criteria, which would then show thumbnails, and a click would bring up the full size image.... Thanks for all the help!

                P 1 Reply Last reply
                0
                • M Mike L

                  That would certainly make it easier, but won't having a database and an "add picture and keywords" type of functionality make it easier to store, retrieve, and catalog? I have literally thousands and thousands of travel photos from all over the world, and want to be able to give friends and family the ability to search by subject, then return those that match the criteria, which would then show thumbnails, and a click would bring up the full size image.... Thanks for all the help!

                  P Offline
                  P Offline
                  Paul Conrad
                  wrote on last edited by
                  #8

                  You could still just store the path to the pictures even with searching abilities.

                  "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                  M 1 Reply Last reply
                  0
                  • P Paul Conrad

                    You could still just store the path to the pictures even with searching abilities.

                    "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                    M Offline
                    M Offline
                    Mike L
                    wrote on last edited by
                    #9

                    The logic and the simplicity of that just dawned on me - I still get "protected" storage from the site, and retain search and keyword capbilities. Plus I don't have the overhead of database load/unload and the associated database size issues. Thanks Paul - that seems to be the most sensible approach and also easiest.

                    P 1 Reply Last reply
                    0
                    • M Mike L

                      The logic and the simplicity of that just dawned on me - I still get "protected" storage from the site, and retain search and keyword capbilities. Plus I don't have the overhead of database load/unload and the associated database size issues. Thanks Paul - that seems to be the most sensible approach and also easiest.

                      P Offline
                      P Offline
                      Paul Conrad
                      wrote on last edited by
                      #10

                      No problem. Glad it is working out for you :)

                      "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups