Search Errors

Discussion in 'General Support' started by sweetness, Nov 22, 2011.

  1. sweetness

    sweetness New Member

    Joined:
    Nov 10, 2011
    Messages:
    4
    Likes Received:
    0
    Hi... I'm having some problems with errors on the search part of my site:

    22-11-2011, 14:01:35:: Unknown error type: [8] Undefined variable: catstr on /home/auctions/public_html/admin/categories.php line 30
    22-11-2011, 14:01:53:: Array
    22-11-2011, 14:02:09:: Database access error. Please contact the site administrator. SELECT * FROM auctions_webidauctions WHERE
    (title LIKE '%archery%' OR id = 0)
    AND (category IN (965,966,967,968,969,970,971,972,973,974,975,976,977) OR secondcat IN (965,966,967,968,969,970,971,972,973,974,975,976,977)
    AND closed = 0 AND suspended = 0 AND starts <= 1321988529 AND ends > 1321988529
    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:/home/auctions/public_html/search.php line:71
    22-11-2011, 14:02:17:: Unknown error type: [8] Undefined index: ERROR on /home/auctions/public_html/cache/tpl_default_search.tpl.php line 6
    22-11-2011, 14:02:32:: Database access error. Please contact the site administrator. SELECT * FROM auctions_webidauctions WHERE
    (title LIKE '%arrows%' OR id = 0)
    AND (category IN (965,966,967,968,969,970,971,972,973,974,975,976,977) OR secondcat IN (965,966,967,968,969,970,971,972,973,974,975,976,977)
    AND closed = 0 AND suspended = 0 AND starts <= 1321988552 AND ends > 1321988552
    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:/home/auctions/public_html/search.php line:71

    I contacted my host and they said they can't help me, so I'm hoping someone here can.

    Thanks,
    Sharon
     
  2. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,568
    Likes Received:
    544
    Hi sharon.

    I dont seem to get the errors I just ran a search on your site for the term custom and results where displayed with no errors
     
  3. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,568
    Likes Received:
    544
    Could I ask if you have any other errors regarding index.php @ line 160

    Please log in to your webid admin and click on tools at the top and past your error log here
     
  4. sweetness

    sweetness New Member

    Joined:
    Nov 10, 2011
    Messages:
    4
    Likes Received:
    0
    Okay... hopefully I'm logged in an able to post this time.. I get errors about not being logged in to post.

    getting back to what happens on a search on my site:

    Hi.. so far I've got this error from the user end from a search on hunting and then archery..
    An unexpected error occurred. The error has been forwarded to our technical team and will be fixed shortly
     
  5. sweetness

    sweetness New Member

    Joined:
    Nov 10, 2011
    Messages:
    4
    Likes Received:
    0
    Hi Nathan... I have the last few errors below... it's a live site so I don't know if others are searching as well:

    26-11-2011, 23:34:49:: Unknown error type: [8] Undefined index: bn_only on /home/auctions/public_html/index.php line 158
    26-11-2011, 23:34:49:: Unknown error type: [8] Undefined variable: j on /home/auctions/public_html/index.php line 203
    26-11-2011, 23:35:25:: Database access error. Please contact the site administrator. SELECT * FROM auctions_webidauctions WHERE
    (title LIKE '%archery%' OR id = 0)
    AND (category IN (965,966,967,968,969,970,971,972,973,974,975,976,977) OR secondcat IN (965,966,967,968,969,970,971,972,973,974,975,976,977)
    AND closed = 0 AND suspended = 0 AND starts <= 1322368525 AND ends > 1322368525
    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:/home/auctions/public_html/search.php line:71
    26-11-2011, 23:35:27:: Unknown error type: [8] Undefined index: SESSION_ERROR on /home/auctions/public_html/error.php line 19
    26-11-2011, 22:35:45:: Unknown error type: [8] Undefined index: bn_only on /home/auctions/public_html/index.php line 158
    26-11-2011, 22:35:45:: Unknown error type: [8] Undefined index: bn_only on /home/auctions/public_html/index.php line 158

    Thank you for any help.. I really appreciate it and how smart you are.. :)

    I just wanted to add that the hunting/archery category isn't the only one I have problems with.. there are more, I can post them later on.. it's late for me here.
     
    Last edited: Nov 27, 2011
  6. sweetness

    sweetness New Member

    Joined:
    Nov 10, 2011
    Messages:
    4
    Likes Received:
    0
    Hi again.. I just did 4 different searches and I got this in the error log:

    26-11-2011, 23:55:14:: Database access error. Please contact the site administrator. SELECT * FROM auctions_webidauctions WHERE
    (title LIKE '%archery%' OR id = 0)
    AND (category IN (965,966,967,968,969,970,971,972,973,974,975,976,977) OR secondcat IN (965,966,967,968,969,970,971,972,973,974,975,976,977)
    AND closed = 0 AND suspended = 0 AND starts <= 1322369714 AND ends > 1322369714
    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:/home/auctions/public_html/search.php line:71
    26-11-2011, 23:55:26:: Database access error. Please contact the site administrator. SELECT * FROM auctions_webidauctions WHERE
    (title LIKE '%arrows%' OR id = 0)
    AND (category IN (965,966,967,968,969,970,971,972,973,974,975,976,977) OR secondcat IN (965,966,967,968,969,970,971,972,973,974,975,976,977)
    AND closed = 0 AND suspended = 0 AND starts <= 1322369726 AND ends > 1322369726
    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:/home/auctions/public_html/search.php line:71
    26-11-2011, 23:55:42:: Database access error. Please contact the site administrator. SELECT * FROM auctions_webidauctions WHERE
    (title LIKE '%plants%' OR id = 0)
    AND (category IN (133,134,135,136,137,138,139,140,141,142) OR secondcat IN (133,134,135,136,137,138,139,140,141,142)
    AND closed = 0 AND suspended = 0 AND starts <= 1322369742 AND ends > 1322369742
    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:/home/auctions/public_html/search.php line:71
    26-11-2011, 23:56:13:: Database access error. Please contact the site administrator. SELECT * FROM auctions_webidauctions WHERE
    (title LIKE '%silver%' OR id = 0)
    AND (category IN (555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,579,571,572,573,574,575,576,577,578,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,675,674,673,672,671,670,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773) OR secondcat IN (555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,579,571,572,573,574,575,576,577,578,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,675,674,673,672,671,670,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773)
    AND closed = 0 AND suspended = 0 AND starts <= 1322369773 AND ends > 1322369773
    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:/home/auctions/public_html/search.php line:71
     
  7. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,568
    Likes Received:
    544
    Hmmm seems that this maybe being caused by it putting % in the query I'm not sure why thats happening.

    An example from your errors above is (title LIKE '%archery%' OR id = 0) then the error is
    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 ''

    the '' in the error is telling me that it is %Somthing% between the '' in the query that is throwing the error.

    Not sure how you would fix that though.

    Can you past your line 4 of search.php here please

    Edit: go to your webid homepage and add this to the end of your URL search.php?id=0&q=archery&sub=Search+for+it%21
    and hit enter on your keyboard and let me know the outcome (make sure to put / before search.php if the is not one alredy at the end of your URL)
     
    Last edited: Nov 27, 2011
  8. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,568
    Likes Received:
    544
    Forget the above post I have this exact same problem and it has somthing to do with this code in search.php

    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;
    It has somthing to do with a " speachmark somwher in that code between
    PHP:
    " . $catSQL . "
    And
    PHP:
    AND closed AND suspended AND starts <= " . $NOW . " AND ends " . $NOW;
    I have tried everything I can think of trying but with no luck
     
    Last edited: Nov 27, 2011
  9. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,568
    Likes Received:
    544
  10. micha_shop

    micha_shop New Member

    Joined:
    Oct 3, 2011
    Messages:
    33
    Likes Received:
    2
    hi,i have that message in admin/tools on blank page:
    "Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 36377151 bytes) in /home/ladymall/public_html/admin/errorlog.php on line 39"
    dnt know what means....when i coming in tools appear that,I looking in errorlog.php and i dnt find nothing there...on line 39 about memory size....
     
    Last edited: Jan 25, 2012
  11. micha_shop

    micha_shop New Member

    Joined:
    Oct 3, 2011
    Messages:
    33
    Likes Received:
    2
    I have the same problem, when someone gives the search for a product by category, I is the same message-tehnical...
     
  12. shohel

    shohel New Member

    Joined:
    Jan 24, 2012
    Messages:
    8
    Likes Received:
    2
    I am also in same problem. I am working on it
     
    Last edited: Jan 26, 2012
  13. shohel

    shohel New Member

    Joined:
    Jan 24, 2012
    Messages:
    8
    Likes Received:
    2
    Hi, i have solved the problem.
    Just replace the line number 51 in search.php with //$catSQL = " AND (category IN " . $catalist . ")";//. It should be ok
     
  14. shohel

    shohel New Member

    Joined:
    Jan 24, 2012
    Messages:
    8
    Likes Received:
    2
    Hi, i have solved the problem.
     
  15. shohel

    shohel New Member

    Joined:
    Jan 24, 2012
    Messages:
    8
    Likes Received:
    2
    Hi, i have solved the problem.
    Just replace the line number 51 in search.php with //$catSQL = " AND (category IN " . $catalist . ")";//. It should be ok
     
  16. shohel

    shohel New Member

    Joined:
    Jan 24, 2012
    Messages:
    8
    Likes Received:
    2
    not disable the line 51. just replace the line with this //$catSQL = " AND (category IN " . $catalist . ")";//
    or there you see in line 51// $catSQL = " AND (category IN " . $catalist//just add // . ")";//after the line
    don,t insert // this symbol
     
    Last edited: Jan 28, 2012
  17. shohel

    shohel New Member

    Joined:
    Jan 24, 2012
    Messages:
    8
    Likes Received:
    2
    Can you post the line 51 code? that you have done
     
  18. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,568
    Likes Received:
    544
    I have no time to test this at the moment busy with the redesign of the hosting site, so if someone that has tested this fix could you please post a reply including this fix in the bug foum where I posted it as a bug.

    Thanks
     
  19. shohel

    shohel New Member

    Joined:
    Jan 24, 2012
    Messages:
    8
    Likes Received:
    2
    Search error bug problem solved

    Open the serach.php and replace the line 51 with this line
    PHP:
    $catSQL " AND (category IN " $catalist ")";
    it should be ok
     
    rv68 and nay27uk like this.
  20. shohel

    shohel New Member

    Joined:
    Jan 24, 2012
    Messages:
    8
    Likes Received:
    2
    Thanks for tip! I am new working with webid and also in this forum
     

Share This Page