Error: undefined variables
<p>These are the errors I get.</p>

<pre><code>Notice: Undefined variable:
product_id in /Applications/XAMPP/xamppfiles/htdocs/www2/www.website2.com/admin_area/viewpost.php on line 74

Notice: Undefined variable:
cat_id in /Applications/XAMPP/xamppfiles/htdocs/www2/www.website2.com/admin_area/viewpost.php on line 75

Notice: Undefined variable: 
date in /Applications/XAMPP/xamppfiles/htdocs/www2/www.website2.com/admin_area/viewpost.php on line 76

Notice: Undefined variable:
product_title in /Applications/XAMPP/xamppfiles/htdocs/www2/www.website2.com/admin_area/viewpost.php on line 77

Notice: Undefined variable:
product_img1 in /Applications/XAMPP/xamppfiles/htdocs/www2/www.website2.com/admin_area/viewpost.php on line 78

Notice: Undefined variable: 
product_price in /Applications/XAMPP/xamppfiles/htdocs/www2/www.website2.com/admin_area/viewpost.php on line 79

Notice: Undefined variable:
product_desc in /Applications/XAMPP/xamppfiles/htdocs/www2/www.website2.com/admin_area/viewpost.php on line 80

Notice: Undefined variable: 
product_keywords in /Applications/XAMPP/xamppfiles/htdocs/www2/www.website2.com/admin_area/viewpost.php on line 81
</code></pre>

<hr>

<p><strong>This is the code</strong></p>

<pre><code>&lt;form method="get" action="viewpost.php"&gt;
        &lt;input type="text" name="search" placeholder="Search Product Here" style="border-color: #0CF; border-radius:5px;"&gt;
        &lt;input class="btn btn-default" type="submit" value="Search Product" name="sub" style="border-color:#09F"&gt;
&lt;/form&gt;

        &lt;!--&lt;/div&gt;
        &lt;/div&gt;
        &lt;/div&gt;
         --&gt;


     &lt;?php
    include("includes/connect.php");

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


    $search = $_GET['search'];

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

    $run=mysql_query($query);

    while($row=mysql_fetch_array($run)){
        $product_id= $row['product_id'];
        $cat_id= $row['cat_id'];
        $date= $row['date'];
        $product_title= $row['product_title'];
        $product_img1= $row['product_img1'];
        $product_price= $row['product_price'];
        $product_desc= substr($row['product_desc'],0,100);
        $product_keywords= $row['product_keywords'];
        }

       ?&gt;
       &lt;!--&lt;table class="table-responsive"&gt;--&gt;
    &lt;tr&gt;
    &lt;td&gt;&lt;?php echo $product_id; ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo $cat_id; ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo $date; ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo $product_title; ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo $product_img1; ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo $product_price; ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo $product_desc; ?&gt;&lt;/td&gt;
    &lt;td&gt;&lt;?php echo $product_keywords; ?&gt;&lt;/td&gt;
     &lt;/tr&gt;

    &lt;/table&gt;
    &lt;?php } ?&gt;
</code></pre>