40000 Records only, Make my search page work so slow and page is stuck...
-
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
-
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
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
-
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
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!!!
-
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!!!
Yes, i posted this question in devnetwork.net Thank you, Hockey
-
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!!!
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