Thread: Need help

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    2
    Rep Power
    0

    Need help


    hello
    please i have a question on mysqli.. using php...
    retrieving uploaded images from my db...
    QUESTION: how do i input a thumbnails drop down list of different sizes like. 32*24, 40*60, 64*80 etc.. so when i click on any of the thumbnail size, the image should be displayed in table manner, when sizing changes images per row should also change
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    189
    Rep Power
    0
    Perhaps if you read the sticky on how to post properly you would have better luck with your question.

    EVERYONE needs help when they post here. Try using a subject line that says something meaningful and maybe you'll get more interest.

    Personally - your question implies that you need help with simple html. Read up on the syntax of the select and option tags and then on tables and then use your noggin to put together a solution and THEN worry about the php to generate all that html.
  4. #3
  5. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,960
    Rep Power
    9397
    Do you already have the thumbnails for those sizes? Or do you still need to create them?
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    2
    Rep Power
    0
    Originally Posted by requinix
    Do you already have the thumbnails for those sizes? Or do you still need to create them?
    no, i still need to create them
  8. #5
  9. Confused badger
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2009
    Location
    West Yorkshire
    Posts
    1,111
    Rep Power
    487
    To the OP, your question is not clear ...

    If all you want is a drop-down (a HTML "Select" box) which when a value is selected simply displays ALL the images in the thumbnail of the size selected then all you need to do is add an "onchange" bit of javascript or jquery to resize the image thumbnails in the table. Of course, it gets a little more complex when you want to limit the number of images per row at each size, for that, I think you'd need to submit the form (using onchange), read in the user selected values and then create the table from scratch ... or, I think you could use DIVs instead of TR/TDs .. they should wrap automatically based on the browser viewport (citation needed on that though)

    If you need to create the thumbnails, you should do that when the images are uploaded (you'll have to write a separate one-off script to thumbnail the already uploaded images).
    Simply save these thumbnail file names into a database and when the selection is made by the user, change your SQL to pull back the correct thumbnail size and display to the user.


    Again, it's the display to user bit that'd be the hassle, I'm sure that DIVs are a better solution to a TABLE because they're flexible and can be "wrapped" onto the next "line" if they exceed their container width.
    "For if leisure and security were enjoyed by all alike, the great mass of human beings who are normally stupefied by poverty would become literate and would learn to think for themselves; and when once they had done this, they would sooner or later realise that the privileged minority had no function and they would sweep it away"
    - George Orwell, 1984

IMN logo majestic logo threadwatch logo seochat tools logo