This is my search engine php code. I have three fields in database: Title, Description and Url. But it will only display a search query that matches the Title. How to create a search query to match with Title, Description and Url?
<?php
ini_set('display_errors',0); // turn off php notice & errors
$button = $_GET ['submit'];
$search = $_GET ['search'];
if(strlen($search)<=1)
echo "Search term too short";
else{
echo "You searched for <b>$search</b> <hr size='1'></br>";
mysql_connect("localhost","woogle","woogle");
mysql_select_db("search");
$search_exploded = explode (" ", $search);
foreach($search_exploded as $search_each)
{
$x++;
if($x==1)
$construct .="title LIKE '%$search_each%'";
else
$construct .="AND title LIKE '%$search_each%'";
}
$constructs ="SELECT * FROM searchengine WHERE $construct";
$run = mysql_query($constructs);
$foundnum = mysql_num_rows($run);
if ($foundnum==0)
echo "Sorry, there are no matching result for <b>$search</b>";
else
{
echo "$foundnum results found !<p>";
}