PHPld search - no results

Discussion in 'Directories' started by MeetHere, Feb 26, 2008.

  1. #1
    Hello

    I am using the search function on my (PHPLD v3.2) directory.. but it's giving "no results" for each and every keyword. :(

    I made no changes, it was working before.

    Any help appreciated. Thanks.
     
    MeetHere, Feb 26, 2008 IP
  2. snowbird

    snowbird Notable Member

    Messages:
    3,036
    Likes Received:
    395
    Best Answers:
    0
    Trophy Points:
    290
    #2
    Your host must have upgraded PHP / mySQL. Here's how I fixed the search in my directory (running 3.2 as well):

    In the main directory, open up search.php. Then find the following code (near the bottom):

    $pattern = array ( '/(AND[\s])+/', '/(OR[\s])+/', '/\s+/', '/`+/', '`^[^\w\d]`', '`[^`\w\d]$`' );
    Code (markup):
    Now replace it with:

    $pattern = array ( '#(AND[\s])+#i', '#(OR[\s])+#i', '#[\s]+#', '#[`]+#', '#^[^\w\d]#i', '#[^`\w\d]$#i' );
    Code (markup):
    That should correct your problem.
     
    snowbird, Feb 26, 2008 IP
  3. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #3
    Yes, i changed the host recently. but it was a complete backup.

    you mean replace / with # ?
     
    MeetHere, Feb 26, 2008 IP
  4. snowbird

    snowbird Notable Member

    Messages:
    3,036
    Likes Received:
    395
    Best Answers:
    0
    Trophy Points:
    290
    #4
    Just replace the whole line of code. There are some other minor changes in there as well. Backup search.php just in case.

    Your new host is probably running the newer version of PHP. If memory serves me correct, PHP version 5.2.5 is what caused the search function to fail.
     
    snowbird, Feb 26, 2008 IP
    MeetHere likes this.
  5. mikey1090

    mikey1090 Moderator Staff

    Messages:
    15,869
    Likes Received:
    1,055
    Best Answers:
    0
    Trophy Points:
    445
    Digital Goods:
    2
    #5
    I too am having this problem. I'll try your solution Snowbird! :)
     
    mikey1090, Feb 26, 2008 IP
    Smyrl likes this.
  6. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #6
    fixed.... :)
     
    an0n, Feb 26, 2008 IP
    MeetHere likes this.
  7. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #7
    lol.
    And its working. Thanks snowboard and anoon. :)
    DP support is quicker than phpld forum. :D
     
    MeetHere, Feb 26, 2008 IP
  8. JamieG

    JamieG Banned

    Messages:
    1,825
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ouch!!!! That hurt, not me but them. :p glad to see you fixed it though and it's An0n not anoon.
     
    JamieG, Feb 26, 2008 IP