Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2012
    Location
    USA
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Store an image location in mysql db for it to appear in dynamic table.

    Hello All,

    I've got a dynamic table and i want to add a new column that will show the image that i have linked to it.

    How would i save the image location/directory in to the DB so that it would know what image to show for what row/record in the table?

    I am using DW if that helps

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,700
    Thanks
    80
    Thanked 4,658 Times in 4,620 Posts
    I am using DW if that helps
    I can't think of anything that hurts more. DW--more accurately named "Nightmare Maker"--produces some of the worst code possible in every language it works with.

    Anyway, this really has nothing to do with DrunkWalker.

    You just need to use some database tool to add the column to your table.
    And then *YOU* need to decide what to store in that column.

    If all your images will be in the same directory, then I'd recommend just storing the name of the image and nothing more. That way, if you move or rename the directory, your database contents don't need to be changed.

    If you are using, say, a two-level sytem (say you have /images/fullsize/butterfly.jpg and /images/thumbnail/butterfly.jpg ), then again store only the last part of the path. Just "fullsize/butterfly.jpg" or "thumbnail/butterfly.jpg". Again, that means you could later move the "images" master directory (or rename it) and the DB contents don't change. Do NOT store the full path to the images.

    I do have to ask: What do you mean by "dynamic table"??
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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