Help me in this work

Discussion in 'PHP' started by balasun, Sep 5, 2008.

  1. #1
    Hello all,

    I want to made search in two tables for one keyword and get a result.
    $searchtxt is the search keyword.

    My codings are as follows:

    But so many results are comes.


    
    $searchtxt=stripslashes(strtolower($_REQUEST["txtSearch"]));
     $searchtxt1=stripslashes(strtoupper($_REQUEST["txtSearch"]));
    //my query is:
    $sql="SELECT * FROM page_content as p,glossary as g WHERE (p.proddesc LIKE '%$searchtxt%') or (p.proddesc LIKE '%$searchtxt1%') or (g.gdesc LIKE '%$searchtxt%') or (g.gdesc LIKE '%$searchtxt1%') or (g.gname LIKE '%$searchtxt%') or (g.gname LIKE '%$searchtxt1%')";
    
    Code (markup):
    Is above coding is correct?

    Please help me in this..
     
    balasun, Sep 5, 2008 IP
  2. lanmonkey

    lanmonkey Active Member

    Messages:
    549
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #2
    have you tried it? does it work?

    I smell someone trying to get us to do his homework for him.
     
    lanmonkey, Sep 5, 2008 IP