need help to develop a search page........

Discussion in 'PHP' started by kcm4web, Dec 22, 2010.

  1. #1
    hi gurus

    i need your help u guys. i need to develop a search page. the thong is that when i write any text in the search input it will show me the result populated from the content field. suppose if i give "saving" in the search , then it will show me the all result where saving word is written. can it be possible?? pls help me

    i am using php and mysql
     
    kcm4web, Dec 22, 2010 IP
  2. Simple Management

    Simple Management Peon

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use OR and LIKE operators.
     
    Simple Management, Dec 22, 2010 IP
  3. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Here is a query example that will make things a bit clearer :
    
    mysql_query("SELECT * FROM your_table WHERE field1 LIKE '%".$serch_word."%' OR field2 LIKE '%".$search_word."%'");
    
    PHP:
     
    tvoodoo, Dec 22, 2010 IP