www.webdeveloper.com
Results 1 to 4 of 4

Thread: Filter

  1. #1
    Join Date
    Dec 2011
    Posts
    39

    Filter

    Sir I am using these codes

    PHP Code:
    <div id="search">
            <label for="filter">Filter</label> <input type="text" name="filter" value="" id="filter" />
    </div>   
    <br /> 
                <table cellpadding="2" cellspacing="0" width="90%" id="resultTable">
              <thead>
                <tr>
                  <th> <strong>ID</strong> </th>
                  <th> <strong>Name</strong> </th>
                  <th> <strong>Mobile</strong> </th>
                  <th> <strong>City</strong> </th>
                  <th> <strong>Country</strong> </th>
                </tr>
              </thead>
              <tbody>
    <?php
    $sql 
    "SELECT * from contacts order by name" ;
    $select mysqli_query($con$sql);
    $run_sel mysqli_fetch_array($select);
    $row=mysqli_num_rows($select);
    //echo ($row);
    $a 1;
    while(
    $a<=$row)
    {
        echo 
    "<tr>";
        echo 
    "<td> <a href='contacts.php?id=".$run_sel['id']."'>
        <img border=\"noborder\" src=\"images/pencil.png\" title=\"Display\"></a></td>"
    ;
        echo 
    "<td align='left'> " $run_sel["name"].  "</td>";
        echo 
    "<td> " $run_sel["moba"]. "</td>";
        echo 
    "<td> " $run_sel["city"]. "</td>";
        echo 
    "<td> " $run_sel["country"] . "</td>";
        echo 
    "</tr>";
        
    $run_sel mysqli_fetch_array($select);
        
    $a++;
        
    }
    ?>
            </tbody>
           </table>
    These codes display following data
    http://i43.tinypic.com/or45r8.jpg

    Now I want to apply incremental search with Filter box.

    For example:

    If I type "B" then all matching records (name field in table) which begins with "B" must appear in display list.

    Please help

  2. #2
    Join Date
    Nov 2013
    Posts
    33
    check out Pattern matching

  3. #3
    Join Date
    Dec 2011
    Posts
    39
    Your answer is not related to my question.

  4. #4
    Join Date
    Nov 2013
    Posts
    33
    ? you want us to do your work for you because you want to filter you results if your using SQL then you need to use the LIKE function which will return a result set with what is being search for.
    Unless this is not what you need if you could explain better what it is you want!

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles