SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    24 open connections

    Hi-- I'm quite a novice. I recently made a page of thumbnails from my db (mysql/php) with each one being a separate mysql connection using the SELECT command. I had to do it this way so each one could have a separate link (to the bigger, hi res version of the pic). It doesn't seem slow or anything and I have used the mysql close command for each. Can anyone tell me what might be bad about having 24 connections open at once? Or for that matter, 100 or 200?
    Opportunity favors the prepared mind.

  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Having that many connections open at once, doing the exact same thing as the other can really tax the system, especially with something like high-res photos.

    What I would suggest is storing an ID with your pictures and using that to reference the bigger image, using it to link.

  3. #3
    SitePoint Evangelist
    Join Date
    May 2005
    Location
    Houston, Texas, USA
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you explain a little bit about storing an ID? Would that be part of the code on the page or in the table itself?
    Opportunity favors the prepared mind.

  4. #4
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Well you would store the ID in the table so you would have

    TABLENAME
    image_id | image_data

    Then in your code you would select all from that table and create a link using the selected ID to link to the larger version.

  5. #5
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    can you post the your current tbale layout and the piece of PHP/SQL code you use to display the thumbmails?


Bookmarks

Posting Permissions

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