<?php
$connect = mysqli_connect("localhost","root","muarem1");
mysqli_select_db($connect,"mydb");
if(isset($_GET['search']))
$searchvalue = $_GET['value'];
$query = "SELECT * FROM `mydb`.`sites` WHERE `sitekeywords` LIKE '%$searchvalue%'";
$try = mysqli_query($connect,$query);
if ( mysqli_num_rows($try) <=0) { echo "<br><center>Sorry, no results found for <b>$searchvalue</b>. Try different search or check back again later. </center></br> ";}
else {
while($row=mysqli_fetch_array($try))
{
$title = $row['sitetitle'];
$link = $row['sitelink'];
$desc = $row['sitedesc'];
echo "<h1>$title</h1><a href='$link'>$link</a><p>$desc</p>";
}
}
?>
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in D:\Users\muarem\mywebsite\test.php on line 22
$connect = mysqli_connect("localhost","root","muarem1");
mysqli_select_db($connect,"mydb");
if(isset($_GET['search']))
$searchvalue = $_GET['value'];
$query = "SELECT * FROM `mydb`.`sites` WHERE `sitekeywords` LIKE '%$searchvalue%'";
$try = mysqli_query($connect,$query);
if ( mysqli_num_rows($try) <=0) { echo "<br><center>Sorry, no results found for <b>$searchvalue</b>. Try different search or check back again later. </center></br> ";}
else {
while($row=mysqli_fetch_array($try))
{
$title = $row['sitetitle'];
$link = $row['sitelink'];
$desc = $row['sitedesc'];
echo "<h1>$title</h1><a href='$link'>$link</a><p>$desc</p>";
}
}
?>
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in D:\Users\muarem\mywebsite\test.php on line 22