Creating a PHP Search

Joseph Smith · 659K views · 2012 · 14:44

Open on YouTube

Web developmentDatabases & storagetutorialdated

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they followed when building a PHP database search, usually in questions where their copied code errors out or returns nothing.

Recommended by 0 people across 0 different months, 2017 to 2020.

What it is

A 2012 screencast by Joseph Smith that builds a basic PHP search form which filters rows from a database table based on user input. The presenter admits to mistakes in the recording and points to a follow-up video that makes the search instant with jQuery.

What people said

Cites Kl12 · 2017-12 · Stack Overflow · on “Creating a search in php - typing in a city and getting the attractions for that city listed below”

I followed this tutorial [this video] and added your code in to the $query. I am currently getting an error Fatal error: Uncaught Error: Call to undefined function mysql_query() in SEARCH.PHP FILE on line 8. Do you know what that means?

Cites Brody Gore · 2018-11 · Stack Overflow · on “My PHP code to search for a first name or last name from a table in a database is not printing anything to my webpage”

The user suppose to input first name or last name into a search bar in a web-page and it suppose to list attributes from the table into the web-page. No matter what I type into the search bar, nothing is outputted. I followed this [this video] video on how to search in php. I tried looking at it over an hour but I can't find anything wrong. I get no error messages in my webpage. <?php $serverName = 'localhost'; $userName = 'root'; $password = ''; $databaseName = 'project3'; $connection = mysqli_connect($serverName, $userName, $password, $databaseName); if (!$connection) { die("Connection Failed: " . mysqli_connect_error()); } echo "Connected Successfully!! <br>"; $output = ''; if (isset($_Post['s

Cites Upchanges · 2020-05 · Stack Overflow · on “How to create search function for data from SQLite database?”

My PHP codes don't work because I'm using a localhost instead of a host server??Or may be because I put tag not in the head/body tag of the HTML file?? Hi! I store data in my SQLite database and I tried using PHP to let the users search for those data and see them through HTML. I followed this Youtube video as the tutorial: [this video] but I couldn't make it work. When I input something(for example: new) in the search bar and submit it, nothing happens, no search results are shown. (Aside from the website link change to " [LINK] ") I'm struggling very hard with this. I would greatly appreciate if you could help me. Thank you. Below are my codes and some screenshot of the website that may help yo