kevbev16 Posted December 23, 2008 Share Posted December 23, 2008 I bought this auction script and the search engine does not work properly. at the moment it is searching for exact phrases/words they continue on from each other so if you look on my website at http://www.bid4tackle.com/detail.php?item_id=752 it is called "Fox Evolution 3 Rod Holdall " at the moment you would have to search for the exact continuous words so "fox Evolution 3 Rod Holdall" or "fox evolution 3 rod" or "fox evolution" i.e. any keywords which follow each other e.g. "3 rod holdall". i want it to search for keywords so it would appear if you searched for "fox", "evolution" ... or key words which are not continuous so "fox" + "rod holdall" or "evolution" +"Holdall"etc. i am only 18 and know very little about php if you could help i would be much appreciative. if($mode=="keysearch") { if(!empty($key_word)) { $key_word=trim($key_word); $sql="select * from user_registration where user_name='$key_word' "; $table=mysql_query($sql); if($row=mysql_fetch_array($table)) { $user_id = $row['user_id']; } $sql="select * from placing_item_bid where status=\"Active\" and selling_method!=\"want_it_now\" and selling_method!=\"ads\" and (item_title like \"%$key_word%\" or detailed_descrip like \"%$key_word%\" or item_id=\"$key_word\" or user_id=\"$user_id\") and bid_starting_date <= now() and "; } else { $sql="select * from placing_item_bid where status=\"Active\" and selling_method!=\"want_it_now\" and selling_method!=\"ads\" and bid_starting_date <= now() and expire_date>=now()"; } if(!empty($show)) { if($show=="all") $sql.=" ( selling_method= \"auction\" or selling_method= \"dutch_auction\" or selling_method= \"fix\" ) "; else if($show=="bid") $sql.=" ( selling_method= \"auction\" or selling_method= \"dutch_auction\") "; else if($show=="buy") $sql.=" selling_method=\"fix\" "; } $sql=rtrim($sql," and "); $save_sql=$sql; $save_sql=$sql; } some one has already told me that the person who coded this is a bit mad. someone esle said try : $sql="select * from user_registration where user_name LIKE '%".$key_word."%' "; but that did not work. i have attached the [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/138238-new-auction-website/ Share on other sites More sharing options...
timmah1 Posted December 23, 2008 Share Posted December 23, 2008 You could try their support http://support.ajsquare.com/support/ Or their live supprt http://messenger.providesupport.com/messenger/ajsquare.html?ps_s=SsebIPvi8E1E&ps_mht=false I'm sure they'd be able to help you a lot more since it is their script Quote Link to comment https://forums.phpfreaks.com/topic/138238-new-auction-website/#findComment-722813 Share on other sites More sharing options...
Mikedean Posted December 24, 2008 Share Posted December 24, 2008 I agree, whoever wrote this was mad, however I'm pretty sure I have it fixed (although it is late and I am slightly tired, so if it doesn't work, I'll take another look tomorrow.) if($mode=="keysearch") { if(!empty($key_word)) { $key_word=trim($key_word); $newKeywords = explode( " ", $key_word ); $sql="select * from placing_item_bid where status=\"Active\" and selling_method!=\"want_it_now\" and selling_method!=\"ads\" and "; for( $i = 0; $i < count( $newKeywords ); $i++ ) { $userSQL="select * from user_registration where user_name LIKE '%" . $newKeywords[$i] . "%'"; $table=mysql_query($userSQL); if($row=mysql_fetch_array($table)) { $user_id = $row['user_id']; } $sql.= "(item_title like \"%" . $newKeywords[$i] . "%\" or detailed_descrip like \"%" . $newKeywords[$i] . "%\" or item_id=\"" . $newKeywords[$i] . "\" or user_id=\"$user_id\") and "; } $sql.="bid_starting_date <= now() and "; } else { $sql="select * from placing_item_bid where status=\"Active\" and selling_method!=\"want_it_now\" and selling_method!=\"ads\" and bid_starting_date <= now() and expire_date>=now()"; } if(!empty($show)) { if($show=="all") $sql.=" ( selling_method= \"auction\" or selling_method= \"dutch_auction\" or selling_method= \"fix\" ) "; else if($show=="bid") $sql.=" ( selling_method= \"auction\" or selling_method= \"dutch_auction\") "; else if($show=="buy") $sql.=" selling_method=\"fix\" "; } $sql=rtrim($sql," and "); $save_sql=$sql; $save_sql=$sql; } The one possible problem I can see is with it searching the users, but I still think it's worth a try . Quote Link to comment https://forums.phpfreaks.com/topic/138238-new-auction-website/#findComment-722873 Share on other sites More sharing options...
kevbev16 Posted December 24, 2008 Author Share Posted December 24, 2008 i gave that code a try but it did not seem to work. i have tried for over 6 months to get some help from AJ square but quite frankly their service is appauling. They keep telling me there is nothing they can do. Kind regards, Kevin Quote Link to comment https://forums.phpfreaks.com/topic/138238-new-auction-website/#findComment-723066 Share on other sites More sharing options...
Mikedean Posted December 24, 2008 Share Posted December 24, 2008 Unless I misunderstood what you planned on the search doing, it looks like it is working for me. I did a search for "fox" and it displayed all of the products with it in their title. Same for when you search for "rod holdall," it brings back the one product with rod holdall in it's name. Could you provide more information on what you want from this search feature? Quote Link to comment https://forums.phpfreaks.com/topic/138238-new-auction-website/#findComment-723099 Share on other sites More sharing options...
kevbev16 Posted December 24, 2008 Author Share Posted December 24, 2008 hi Mike, Sorry i didn't really explain the problem very well. at the moment the script currently searches for continous words/phrasess. so on my website, if some one wants to search for "fox holdall" in a search it will not show up because it is not isolating them as seperate words.so i want it to search for key words so, "fox" + "holdall" and then match it up with the key words in the title.http://www.bid4tackle.com/detail.php?item_id=752 at the moment if you search for, "fox holdall" it will not work because you have to type in a continuous set of words e.g. "fox evolution" or "3 rod holdall" and i want to ge trid of this. Kind regards, Kevin Quote Link to comment https://forums.phpfreaks.com/topic/138238-new-auction-website/#findComment-723105 Share on other sites More sharing options...
Mikedean Posted December 24, 2008 Share Posted December 24, 2008 Oh I see, I could of swore my code would have worked then . Are the code changes I made currently on the website or did you replace with the old version? Quote Link to comment https://forums.phpfreaks.com/topic/138238-new-auction-website/#findComment-723114 Share on other sites More sharing options...
kevbev16 Posted December 24, 2008 Author Share Posted December 24, 2008 you are a genius!! i have just tried it again and it works when i did it before i tested it from the homepage, http://www.bid4tackle.com and it doesn't seem to work from there for some reason. it does however work from http://www.bid4tackle.com/search.php (the top search box only) thank you for your help. would the problem to the search engine on the homepage lie in the homepage file. thank you so much kev Quote Link to comment https://forums.phpfreaks.com/topic/138238-new-auction-website/#findComment-723119 Share on other sites More sharing options...
Mikedean Posted December 24, 2008 Share Posted December 24, 2008 It shouldn't have made a difference really and after running a couple of tests through myself, it seems to working exactly the same. I did a search for "evolution rod" and returned the correct results. Quote Link to comment https://forums.phpfreaks.com/topic/138238-new-auction-website/#findComment-723122 Share on other sites More sharing options...
kevbev16 Posted December 24, 2008 Author Share Posted December 24, 2008 Thanks for your help so far- i am very grateful. How can the search box on the left hand side be changed so it functions in the same way as the one at the top of the page that workshttp://www.bid4tackle.com/search.php there are so many problems with that left hand column tick box search. firstly, if you select the "buy it now" box and then type in "fox" at the search box to the left it shows all "fox" products independant of whether they are "buy it now". this also seems to be the case when you type in the item condition as "New" or "old" it will display all items called "fox" even though they are not that condition. this would suggest that it is searching for the name in the search box and ignoring and ticks that have been made in the "search options" section. likewise if you search for price "0" to "£100" and also tick "buy it now" it will display all "buy it now" items despite not being in that price bracket. finally, when you select the location box and tick the "worldwide" or "europe" box it does not show the UK for some reason. i understand there is loads there to do but if anyone could help me i would be very grateful (i have attached the relevant files. the search.php is the main one to focus on but the problems with the homepage search, may lie in the index_top.php file (near the bottom) cheers kev [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/138238-new-auction-website/#findComment-723145 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.