[Solved] Error: undefined variables


Now this is just a guess, but your $search might be empty. That would result in a query along the lines of “SELECT * FROM products WHERE product_keywords LIKE ””, returning 0 rows.

The fix would be:

<?php    
include("includes/connect.php");

if(isset($_GET['sub'])){


$search = $_GET['search'];
if (isset($search)){

  $query ="select * from products where product_keywords="$search" ";

  $run=mysql_query($query);
?>
<table class="table-responsive">
<tr>
<?php
    while($row=mysql_fetch_array($run)){
        echo '<td>'. $row['product_id']. '</td>';
        echo '<td>'. $row['cat_id']. '</td>';
        echo '<td>'. $row['date']. '</td>';
        echo '<td>'. $row['product_title']. '</td>';
        echo '<td>'. $row['product_img1']. '</td>';
        echo '<td>'. $row['product_price']. '</td>';
        echo '<td>'. substr($row['product_desc'],0,100). '</td>';
        echo '<td>'. $row['product_keywords']. '</td>';
        } 
     }
 ?>

Try this and see whether it disappears. If not, there’s something else wrong.

solved Error: undefined variables