<?php
     $username = "root";
     $password = "";
     $hostname = "localhost";
     $db_handle = mysql_connect($hostname, $username, $password) or die ("Could not connect to database");
     $selected= mysql_select_db("login", $db_handle);
     $output='';
     if(isset($_POST['search'])){
         $searchq = $_POST['search'];
         $query= "SELECT * FROM PHP_Item WHERE Name LIKE '%searchq%' OR Description LIKE '%serachq%'" or die ("could not search");
         $result= mysql_query($query);
         $count= mysql_num_rows($result);
         echo $count;
         if($count <1){
             $output = 'there were no search results';
         }else{
             while($row = mysql_fetch_array($query)){
                 $mName = $row['Name'];
                 $price = $row['Price'];
                 $id= $row['ItemID'];
                 $output .= '<div>'.$mName.' '.$price.'</div>';
             }
         }
     }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> --><!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> --><!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> --><!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
<html>
    <head>
        <title>Movie Search-Search for a movie</title>
    </head>
    <body>
        <form action="search.php" method="POST">
              <input type="text" name="search" placeholder="Find movies..."/>
              <input type="submit" value="Search movies"/>
        </form>
            <?php print("$output");?>
    </body>
</html>
Im trying to impliment a search bar on my website where users can enter the name of a movie and it will return movies with the same or a similar name to the user's search.
The database being searched has 3 fields-->> ItemID, Name, Description. I keep getting 0 results with the 'there were no search results' output. Any ideas what the problem is?
 
     
    