Creating a Custom Search Engine in PHP & MySQL (Video Tutorials)

Hey Guys, What’s up?

Today I’m serving you with few PHP tutorials regarding “Creating a Search Engine in PHP“, it is however, a very basic PHP & MySQL tutorial series to know the basic idea for creating a search engine in PHP. For advance tutorials, you may connect with me using this blog, so I can update you in the future.

search engine in PHP

This tutorial is aiming to teach you “Creating a very basic search engine in PHP” which can display the relevant results on the browser upon the users’ query in the search box. We’ll use PHP $_GET method to receive the input from the users and then we’ll display the results using a MySQL Query. There are many filters, we’ve set while creating this simple PHP tutorial, and You’ll learn all the steps live by watching my video tutorials on this page.

Before You learn this project, kindly have a look at my other PHP projects as well: 

What we’ll learn by watching this series?

  • Creating an HTML form for providing search option to the users
  • Creating a database to insert some dummy data
  • To display the relevant results upon users’ request

Let’s start! what you’ll need to create a search engine?

  • First of all kindly open your favorite text editor i.e Notepad++ or DW etc
  • Create a file called “search.php
  • Now go to “PHPmyAdmin” located at “XAMPP” your localhost
  • Create a database called “my_db” or name it anything you’d like
  • Create a table “sites” & add 5 columns for i.e Keywords, title, description etc
  • Now just insert some dummy data into the columns
  • You are ready to Go!

After doing above steps, now you can easily create your first ever search engine in PHP very easily with my video tutorials in English. Just watch the given video tutorial series below to know each and everything for creating a search engine in PHP. However, don’t forget to find the source code for this project below the videos:

Creating a search Engine in PHP video tutorial # (1)

Creating a search Engine in PHP video tutorial # (2)

Creating a search Engine in PHP video tutorial # (3)

So after watching the videos, you have clearly understood the steps to create a very simple search engine in PHP in my simple and funny English 🙂 However, you can also have the source code for this project. I want to give you everything for your own project.

The Source Code for this project

Now here is the whole source code which I used in this tutorial, just copy the below given source code and use it in your own practicing project:

<title>Search Engine in PHP</title>
</head><body><form action=”search.php” method=”get”>

Search Engine:<input type=”text” name=”value” placeholder=”Search Anything here”>
<input type=”submit” name=”search” value=”Search Now”>



$search_value = $_GET[‘value’];

$query = “select * from sites where site_keywords like ‘%$search_value%'”;

$run = mysql_query($query);


$title = $row[‘site_title’];
$link = $row[‘site_link’];
$desc = $row[‘site_desc’];

echo “<h1>$title</h1><a href=’$link’>$link</a><p>$desc</p>”;




Now let me go to sleep, because this is late night here 🙂 and have fun with PHP web development. While you can wait for my upcoming exciting tutorials in PHP & MySQL. And take few seconds to share this tutorial with all of your friends and have a sweet life.

Oh! I forgot to tell you that if you have any question then kindly comment below the post or just post some compliment for this tutorial. Thanks again.

About Abdul Wali

Abdul Wali is a professional blogger, marketer and web developer working online for last 5 years, he's been deeply involved in PHP, Web Development, SEO and computer video tutorials in different languages i.e English, Urdu and Pashto. You can catch him on and add him on Facebook.

Check Also


Best Websites to Buy PHP Scripts & Themes

PHP is a powerful web development language and many popular platforms are built with PHP ...

  • Hi,
    I got the tutorial search engine and I would like to know how I could do a PHP redirect with all results (without referencing) as does google for example.
    Thank you very much for your tutorials they helped me a lot!
    PS: Sorry for my english I’m french.

  • Please watch my tutorials on Advanced search engine in PHP available on this blog. thanks

    • talha khan

      wali bhai thank you very much its talha khan from karachi your tutorials were fantastic they not only helped me in completion of my php projects but cleared my all php concepts as well. thank u very much. God bless u keep it up brother.

  • martin

    Hello can’t get advanced search engine tutorial please help locating it. And wish you would use mysqli in the tutorial. Thanx

  • sahil

    Suppose if we use this search query for 4 tables ..named A,B,C,D…then what will be the query ?? &…& Column Names are same in all 4 tables …..& all 4 tables have its own primary key……please help me..

  • tunegh

    Hello Abdul wali please can’t you update this to fro MYSQL to MYSQLI