Php : How To Search And Filter Data In Html Table Using Php And MySQL Database [ with source code ]


How To Find Data In MySQL Database And Display It In Html Table Using Php

Source Code:

PHP Programming Tutorials ➜

PHP And MySQL Tutorials ➜

PHP Course For Beginners ➜

Learn PHP By Building Projects ➜

Web Development Course ➜

Website Builder Tool ➜

visit our blog





Share This Video:

In this Php Tutorial You will see How You Can Make Search Input Text And Show Data With Input Text Value In Html Table Using MySQL Database And Php .

I Use In This Tutorial:
– NetBeans IDE .
– PhpMyAdmin .

Others Tutorials :

Get Select Option Value From MySQL Database Using Php

How To Populate Html Table From MySQL Database Using Php

How To Use Mysqli Num Rows In Php

How To Use Pdo Row Count In Php

Insert Update Delete Search Data In MySQL Database Using Php Part1

Check Out This:
Top Programming Courses On Udemy


👉 Web Development Course:
👉 Javascript Courses:
👉 Python Course:
👉 React Course:
👉 PHP Course For Beginners:
👉 ASP.NET Course:
👉 Data Science Course:
👉 Machine Learning Courses:
👉 Full-stack .NET Developer Course:
👉 Docker Course:



  1. need help!!
    Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /home/vol13_6/ on line 55

  2. hey guys. what's the problem with this ===
    Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool

  3. This isn't really a filtered search result, it is a backwards search by elimination. How about a page with only a search text box on it with a checkbox that when "checked" will filter out OR only include all the people named John from the database results when you click on a "submit" button.

  4. Awesome! Thank you for your work. Mine worked with this change for the first query.
    "SELECT * FROM tablename WHERE columnname LIKE '%$valueToSearch%'"

  5. when I'm inserting the action in form tag then my code is not working(not even else condition) and without action at least my else is working. I tried a lots of things with this code but nothing is working. please help me out…!

  6. This SQL code is very slow & unsecured.
    Any SQL database can not use index for performence. Please use for teaching good variant for search, as possible use ( first_name like '' or last_name like '' + detect if (is_number($_POST['valueToSearch']) (id like '' OR age like '%%')

  7. thank you this was really great! you made it quite simple,
    I want to ask is it much harder to add multiple filter fields so you can filter at the same time? wow i figured it out it took al ong time, thank u for this very helpful!

  8. hey,
    Thankyou for a nice code.
    i want you ask about the sql query that i want to select the top results from table on user demand. can you please help me.
    example – as i your data select top 5 record filter by age column .
    i am try this —
    $query = "SELECT * FROM `users` ORDER BY count DESC LIKE '".$valueToSearch."' ";
    but its not working .
    please help me.

  9. All Good
    If you are facing any issues regarding mysqli_fetch_array(),
    just remove the single quote from the query you are using
    e-g "SELECT 'patient_id', 'fname, lname', 'gender','dob','address' from patient ";
    "SELECT patient_id, fname, lname, gender,dob,address from patient ";


Please enter your comment!
Please enter your name here