How To Make A Simple Search Engine Using PHP And MySQLi
PHP MySQLi » Simple Search Engine Using PHP And MySQLi
Comments, usually are used to explain Python code,to make the code more readable and to prevent execution when testing code.
In this simple search engine which is searches to user date into the database. similar like google search engine it will check matched keywords to the table title, description, website URL or how you like.
Steps to follow in creating a simple search engine for your website
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(50) NOT NULL,
`description` TEXT NOT NULL,
)
How to Make Simple Search Engine using PHP and MySQLi - examples
We make a HTML file and save it with a name search.html
<!DOCTYPE html>
<html>
<head>
<title>Simple search with PHO and MySQLi</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<h1>Simple search engine with PHP and MySQLi</h1>
<form action="" method="post">
<input type="text" name="search">
<input type="submit" name="submit" value="Search">
</form>
<strong>Go back tu search page <a href="search.html">SEARCH AGAIN</a></strong>
<?php
$server_name = "localhost";
$user_name = "root";
$password = "";
$db_name = "my_data_base";$con=new mysqli($server_name, $user_name, $password, $db_name);
if($con->connect_error)
{
echo 'Connection Faild: '.$con->connect_error;
}
else
$search_value=$_POST["search"];
$sql="select * from search where title like '%$search_value%' OR description LIKE '%$search_value%'";
$res=$con->query($sql);
while($row=$res->fetch_assoc())
echo "<strong>ID </strong>".$row['id']." <strong>Title:</strong> ".$row['title']." <strong>Description</strong> ".$row['description']."<br />";
?></body>
</html>
how to make simple php search engine
How To Make A Simple Search Engine Using PHP And MySQLi - php mysqli
This tool makes it easy to create, adjust, and experiment with custom colors for the web.

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.

Find here examples of creative and unique website layouts.

Find here examples of creative and unique website CSS HTML menu.