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
  1. Home
  2. Web Development
  3. 40000 Records only, Make my search page work so slow and page is stuck...

40000 Records only, Make my search page work so slow and page is stuck...

Scheduled Pinned Locked Moved Web Development
helpphpmysqlquestion
5 Posts 3 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.
  • H Offline
    H Offline
    Hy Chanhan
    wrote on last edited by
    #1

    Dear All, (PHP/MySQL) In my table have record more than 40000 rocords (all are pictures)and i have a search page when i start to search it work so slow and stuck, sometime the time is out. Do you have any idea to help me? please help me. Thanks you alot. From: Chanhan

    C A 2 Replies Last reply
    0
    • H Hy Chanhan

      Dear All, (PHP/MySQL) In my table have record more than 40000 rocords (all are pictures)and i have a search page when i start to search it work so slow and stuck, sometime the time is out. Do you have any idea to help me? please help me. Thanks you alot. From: Chanhan

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      How are you searching if they are all pictures ? What are you searching on ?

      Hy Chanhan wrote:

      Do you have any idea to help me? please help me.

      Well, no, we can't help. You have told us what your code does, and what goes wrong. Until we see what the code is, we can't comment on how it may be done better.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      1 Reply Last reply
      0
      • H Hy Chanhan

        Dear All, (PHP/MySQL) In my table have record more than 40000 rocords (all are pictures)and i have a search page when i start to search it work so slow and stuck, sometime the time is out. Do you have any idea to help me? please help me. Thanks you alot. From: Chanhan

        A Offline
        A Offline
        alex barylski
        wrote on last edited by
        #3

        hehe...I see someone else enjoys codeproject.com from the devnetwork.net web site ;) I answered your question there already so I won't address it here again :) Cheers :)

        It's frustrating being a genius and living the life of a moron!!!

        H 2 Replies Last reply
        0
        • A alex barylski

          hehe...I see someone else enjoys codeproject.com from the devnetwork.net web site ;) I answered your question there already so I won't address it here again :) Cheers :)

          It's frustrating being a genius and living the life of a moron!!!

          H Offline
          H Offline
          Hy Chanhan
          wrote on last edited by
          #4

          Yes, i posted this question in devnetwork.net Thank you, Hockey

          1 Reply Last reply
          0
          • A alex barylski

            hehe...I see someone else enjoys codeproject.com from the devnetwork.net web site ;) I answered your question there already so I won't address it here again :) Cheers :)

            It's frustrating being a genius and living the life of a moron!!!

            H Offline
            H Offline
            Hy Chanhan
            wrote on last edited by
            #5

            Statement below make my search so slow: $sWhere = "c.zipcode =". $searchresultstr; $sWhere = " WHERE (" . $sWhere . ")"; $sWherePlus="AND (p.isbrand=True) AND (p.category_id=1 OR p.category_id=3 OR p.category_id=5 OR p.category_id=6 OR p.category_id=8 OR p.category_id=9 OR p.category_id=13 OR p.category_id=25 OR p.category_id=36)"; $sql_ads="SELECT DISTINCT t.contact_id as t_contact_id FROM `osb_contacts` AS `t` Inner Join `osb_companies` AS `c` ON `t`.`company_id` = `c`.`company_id` Inner Join `osb_products` AS `p` ON `t`.`company_id` = `p`.`company_id` WHERE ((POW((69.1*(c.longitude-\"$lon\")*cos($lat/57.3)),\"2\")+POW((69.1*(c.latitude-\"$lat\")),\"2\"))<($radius*$radius)) $sWherePlus"; $sSQL1="SELECT DISTINCT p.brand_sub_id as p_brand_sub_id FROM (osb_companies c INNER JOIN osb_company_info_details cd ON c.company_id = cd.company_id) INNER JOIN osb_products p ON cd.brand_sub_id = p.brand_sub_id WHERE ((POW((69.1*(c.longitude-\"$lon\")*cos($lat/57.3)),\"2\")+POW((69.1*(c.latitude-\"$lat\")),\"2\"))<($radius*$radius) $sWherePlus)"; ------------------------------------------ The idea that i want: if p.category_id=1 or p.category_id=8 then $radius=50 the other else $radius=1000 Can i use condition if in Where statement of MySQL and Can i set Variable of PHP in Where Statement of MySQL Please help me

            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