Recent Searched Terms

Discussion in 'Programming' started by member1, May 9, 2007.

  1. #1
    hello !

    there is anyone know how make the
    Recent Searched Terms in home page

    i have a moteur of search and i want make Recent Searched Terms appear in this page like this

    ifox.ws
     
    member1, May 9, 2007 IP
  2. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #2
    it seem ur french :)

    moteur => engine .

    just make a simple sql query that will select last xx words from the table where you stock ur searches
     
    commandos, May 9, 2007 IP
  3. IsRoss()

    IsRoss() Peon

    Messages:
    116
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What are you using for your search application? What language are you using or does your server support?
     
    IsRoss(), May 9, 2007 IP
  4. Chris.

    Chris. Guest

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You, when a search is made, just insert it into a table, then use a while() statement to echo them back. here is a simple script that would work for you.

    
    echo"<form action='' method='post'>
    Search: <input type='text' name='search_item' />
    <input type='submit' name='search' value='Search' />
    </form>";
    
    if($_POST['search']) {
         $query = mysql_query("SELECT * FROM table WHERE field LIKE '%$_POST[search]%'");
         $insert = mysql_query("INSERT INTO `table` SET `title` = '$_POST[search]");
    
         while($row = mysql_fetch_array($query) {
         // echo each search here
         }
    
    Code (markup):
    It will need some editing, but the main thing you want is the $insert variable. THen you can echo your recent search terms, I'm sure you cna figure that out.
     
    Chris., May 9, 2007 IP
  5. member1

    member1 Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    68
    #5
    THANKS YOU ALL THANKS YOU VERYMUCH

    i using php language

    that my search engin
    ------------------------------------------------------
    <div id="search">
    		
    				<form action="search.php" method="post" name="search">
                                <input size="50" name="q" class="input">
                                <input name="submit" class="input" value="Go!" type="submit">
                  </form>
    						
    			</div>
    PHP:
    --------------------------------------------------------------------
    i am not good in php i learning now
    and sorry about my bad english

    i will test that Chris. thanks
     
    member1, May 9, 2007 IP