My web site cant search since i hosted but it previously worked fine on my xampp locaholost
the url is www.technestng.com and whatever that is being searched does’nt return any result
here is some of the codes i used.
<?php
$button = $_GET ['submit'];
$search = $_GET ['search'];
$button = mysql_real_escape_string($button);
if(!$button)
echo "You didn't submit a keyword!<br><br>
<ul>
<li>
Search with a general words. For example: If you want to search 'how to create a website'
then use general keyword like 'create' or 'website'</li>
<li> Try different words with similar meaning</li>
<li> Please check your spelling</li></ul>";
else
{
if(strlen($search)<=1)
echo "Search term too short";
else{
echo "You searched for ''<b style='color:#337ab7;'>$search</b>'' <hr size='1'></br>";
include('includes/config2.php');
$search_exploded = explode (" ", $search);
foreach($search_exploded as $search_each)
{
$x++;
if($x==1)
$construct .="postTitle LIKE '%$search_each%'";
else
$construct .="AND postTitle LIKE '%$search_each%'";
}
$construct ="SELECT * FROM blog_posts_seo WHERE $construct";
$run = mysql_query($construct);
$foundnum = mysql_num_rows($run);
if ($foundnum==0)
echo "Sorry, there are no matching result for <b style='color:#337ab7;'>$search</b>.</br></br>
<ul>
<li>
Try more general words. for example: If you want to search 'how to create a website'
then use general keyword like 'create' 'website'</li>
<li> Try different words with similar meaning</li>
<li> Please check your spelling</li>";
else
{
echo "<b>$foundnum results found !</b><p>";
while($runrows = mysql_fetch_assoc($run))
{
$slug = $runrows['postSlug'];
$title = $runrows ['postTitle'];
}