MySQL Help

Discussion in 'MySQL' started by Pudge1, Aug 3, 2010.

  1. #1
    
      function Search($search_term)
       {
        $user = '***';
        $pass = '***';
        $dbname = '***';
    
        $search_term = mysql_real_escape_string($search_term);
    
        $connection = mysql_connect('localhost',$user,$pass);
    
        mysql_select_db($dbname, $connection);
    
        $sql = "SELECT Note_ID FROM Notes WHERE Keywords LIKE '%$keywords%'"
        $query = mysql_query($sql, $connection);
       }
    
    Code (markup):
    So I am kinda new to MySQL so I don't know it that well, how will the results of this search be displayed? Thank you so much if you help :)
     
    Pudge1, Aug 3, 2010 IP
  2. rayqsl

    rayqsl Active Member

    Messages:
    91
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    53
    #2
    Firstly, I think you've got a typo in here - you're selecting using a variable called keywords which should probably be search_term.

    To answer your question - it won't be displayed anywhere. all you've done is get data from the database.

    You'll need to build a web page (I presume you want to show the data on a web page of some kind) to show the data. There are lots of online PHP tutorials that can show you how to do this.
     
    rayqsl, Aug 3, 2010 IP
  3. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #3
    I already solved this problem. Thanks anyway.
     
    Pudge1, Aug 4, 2010 IP