Thread: [REQ] Database Search Function

Results 1 to 2 of 2
  1. #1 [REQ] Database Search Function 
    Registered Member

    Join Date
    Nov 2007
    Posts
    405
    Thanks given
    0
    Thanks received
    0
    Rep Power
    114
    Elo!

    As the title says, I need help to create a "Search Engine" that takes information from your database. So in my case, it would be a username search.

    I would want, a form that uses the phrase given, to search information within a database. I already have the Database etc. I just need the .php and form code for it.

    If you need any more information please PM me.
    /Mede
    Lemon
    Reply With Quote  
     

  2. #2  
    Registered Member D4NyZ's Avatar
    Join Date
    Sep 2008
    Age
    28
    Posts
    664
    Thanks given
    50
    Thanks received
    10
    Rep Power
    30
    The main thing in this PHP script is the MySQL query. Something like
    Code:
    SELECT * FROM table WHERE col LIKE '$keyword%';
    . After that the PHP code will be easy(very easy).
    Code:
    <?php
    $query='SELECT * FROM table WHERE col LIKE "'.$keyword.'%";
    $result=mysql_query($query);
    $data=array();
    while ($row=mysql_fetch_assoc($result)) {
        $data=array_merge($data,array($row));
    }
    // $data will contain all data from mysql where table.col contains $keyword
    ?>
    P.S. This is just a LITTLE LITTLE snippet.
    Spoiler for Retard below:

    Quote Originally Posted by dani_gonzales View Post
    dany i know u hate me because i am better then u,,,so stfu noob and stop spaming my posts or i conntact a moderator!

    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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