Results 1 to 1 of 1

Thread: search feature

  1. #1
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default search feature

    Edit: This IS a MySQL question, my fault.

    Hi, I created a search feature and submitted it here a couple of months ago and being pretty much satisfied with it I went on to try and rewrite my main page into strict CSS. Heh, the hardest thing with CSS is that it behaves so very different depending on the browser.

    My PHP and MySQL knowledge feels like it has atrophied a bit since I spent so much time on CSS as opposed to PHP and MySQL and my original script looks slightly foreign to myself.

    The original thread is here.
    The script in action is here.
    The source script is here.

    The code to be edited is listed here:

    PHP Code:
    $k=count($terms1);
    $trm = array();
    $where_clause=array();
    $l=0;
    $tt1=-1;
    while (
    $l<=$j){$l++;
    while (
    $tt1<$k-1){$tt1++; 
        
    $trm[] = $rip1[$l] LIKE '%$terms1[$tt1]%' ";
    }
    $tt1=-1$where_clause[] = " WHERE " implode (" and ",$trm);unset($trm);
    }
    $r=count($where_clause);
    $tt1=0;
    $tt=0
    What I want to do is add a concat command so that the script will search the specified columns of a table so if there is a match in any or all of the 3 or 4 columns of a row of a table (in this case there are a few different tables) it will display only one result as opposed to listing one result for each column and each table where there is a match.

    In short I want the script to be more efficient in its results.

    Thanks for reading. The hard part about asking for help in a forum is knowing the right question to ask and making the question clear.

    EDIT: I need to extend the where statement to include the columns that I want as opposed to the one specified in each where statement. It is beginning to come back to me (I hope).
    Last edited by james438; 03-06-2007 at 08:37 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •