WeBid Bug Tracking - WeBid
View Issue Details
0000353WeBidAuctionspublic2011-11-27 13:252012-12-12 16:04
nay27uk 
 
noneminorhave not tried
resolvedfixed 
1.0.3 
1.0.4 
355
0000353: An unexpected error occurred. WHEN PERFORMING A SEARCH
Ok this is a bug I dont seem to be able to find a solution to when a user performs a search on site and selects a category from the dropdown we get on the user side
 
Someone wrote


An unexpected error occurred. The error has been forwarded to our technical team and will be fixed shortly

 
In the admin error log we have the following
 
Someone wrote

27-11-2011, 13:16:58:: Database access error. Please contact the site administrator. SELECT * FROM webid_auctions WHERE
(title LIKE '%test%' OR id = 0)
AND (category IN (2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28) OR secondcat IN (2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28)
AND closed = 0 AND suspended = 0 AND starts <= 1322399818 AND ends > 1322399818
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4
page:/MyPath/MyHostingAccount/httpdocs/search.php line:71

 
It seems like the bellow code in search.php has a wrong " speachmark in it somwhere on line 4 I have tried everything I can think to resolve this I have taken out the " one by one but just get a blank page I have replaced the " with ' againe a blank page.
 
I think this is one for a real coder to resolve
 
The code causing the error is this
[PHP] $query = "SELECT * FROM " . $DBPrefix . "auctions WHERE
   (title LIKE '%" . $term . "%' OR id = " . intval($term) . ")
   " . $catSQL . "
   AND closed = 0 AND suspended = 0 AND starts <= " . $NOW . " AND ends > " . $NOW;[/PHP]
 
and here is the link to the original thread
 
http://www.webidsupport.com/forums/showthread.php?4463-Search-Errors[/URL] [^]
 
NOTE: this only happens when the user selects a category to search in, if no category is selected search works with no error
No tags attached.
Issue History
2015-04-01 13:17renlokNew Issue
2015-04-01 13:17renlokimport_id => 355
2015-04-01 13:17renlokDate Submitted2015-04-01 13:17 => 2011-11-27 13:25
2015-04-01 13:17renlokLast Update2015-04-01 13:17 => 2012-12-12 16:04

Notes
(0000907)
shohel   
2012-01-29 03:29   
(edited on: 1970-01-01 00:00)
Open the serach.php and replace the line 51 with this line
[PHP]$catSQL = " AND (category IN " . $catalist . ")"; [/PHP]
 it should be ok
(0000908)
nay27uk   
2012-01-29 13:04   
(edited on: 1970-01-01 00:00)
Thanks shohel.
 
This should help renlok for next release.
 
Good work
(0000909)
shohel   
2012-01-30 04:10   
(edited on: 1970-01-01 00:00)
nay27uk wrote

Thanks shohel.
 
This should help renlok for next release.
 
Good work

You are most welcome