Display table according to the search term

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghjk
    Contributor
    • Jan 2008
    • 250

    Display table according to the search term

    In my application i have a table for retrieving database values. and also i have a search function. In page load in first time i want to display normal table and when searching i want to display only specific values according to the search term. Could you please tell me how can i do that?
  • satas
    New Member
    • Nov 2007
    • 82

    #2
    Originally posted by ghjk
    In my application i have a table for retrieving database values. and also i have a search function. In page load in first time i want to display normal table and when searching i want to display only specific values according to the search term. Could you please tell me how can i do that?
    Try google for
    Code:
    php mysql
    to find out basics. Or try to explain your problem more detailed.

    Comment

    • ghjk
      Contributor
      • Jan 2008
      • 250

      #3
      Originally posted by satas
      Try google for
      Code:
      php mysql
      to find out basics. Or try to explain your problem more detailed.

      I'm developing web application using php. one of my page hase 4 text boxes, search function and table.(teble displays database values). In first time user log in to this page he should display all values in the table. But if he search some value then should only display details accoring to that serch term.

      EX. first time table has 5 record(default database values). Then he search by country(Search By: xxxx). So it should display 2 records those are in that country.

      I want to load the value to same table in both situation.

      Comment

      • satas
        New Member
        • Nov 2007
        • 82

        #4
        Okay, but it is a quite typical application described in the most of tutorials.
        All you need to do is to execute 2 queries and display the results:
        Code:
        SELECT * FROM `table_name`;
        and
        Code:
        SELECT * FROM `table_name` WHERE `country`='country_name';

        Comment

        Working...