Store Multiple Images in Mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghjk
    Contributor
    • Jan 2008
    • 250

    Store Multiple Images in Mysql

    I'm using mysql and php. In my application I want to store multiple images in a database.
    ex: I want to store a vehicle details. vehicle id, type,make and vehicle images. there can be 1 or more images for 1 vehicle. Should I need to create column for vehicle table or should I create separate table for images. Please help me..
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Unlees you really need to, images are better stored directly on the server.
    Then in your table have an extra column that stores the filename.
    The database can quickly grow storing blob data.

    Comment

    • ghjk
      Contributor
      • Jan 2008
      • 250

      #3
      How can I store more images in one column.
      This is my table
      Code:
      vehicleId  vehicleMake 	vehicleModel  imagePath

      Comment

      • mwasif
        Recognized Expert Contributor
        • Jul 2006
        • 802

        #4
        You should create a separate table to store images/images path containing the following 2 fields (you can add more fields if required e.g. image type) e.g.
        vehicleId
        imagePath

        Comment

        Working...