I am looking to use my form to search a second column in the database, the current code below will search the column called companyname but the second does not do anything and i get an error **Notice: Undefined variable: strKeyword2 in line 52 (SELECT LINE) Could you please provide some help as I'm clearly doing something wrong. Many thanks There is my form and code
  Form
  <input name="companyname" type="text" id="txtKeyword" value="">
  <input name="location" type="text"  id="txtKeyword2" size="20" value=""/>
  <input type="submit" value="Search">
  form end
$conn = mysqli_connect($serverName,$userName,$userPassword,$dbName);
ini_set('display_errors', 1);
    error_reporting(~0);
    $strKeyword = null;
    if(isset($_POST["companyname"])){
        $strKeyword = $_POST["companyname"];
    }
    if(isset($_POST["location"])){
        $strKeyword2 = $_POST["location"];
    }
    if(isset($_GET["companyname"])){
        $strKeyword = $_GET["companyname"];         
    }
    if(isset($_GET["location"])){
        $strKeyword2 = $_GET["location"];           
    }
    $sql = "SELECT * FROM reviewsandtips WHERE (companyname LIKE '%".$strKeyword."%' AND location LIKE '%".$strKeyword2."%' ) ";
$query = mysqli_query($conn,$sql);
$num_rows = mysqli_num_rows($query);
$per_page = 2;   
$page  = 1;
if(isset($_GET["Page"]))
{
    $page = $_GET["Page"];
}
$prev_page = $page-1;
$next_page = $page+1;
$row_start = (($per_page*$page)-$per_page);
if($num_rows<=$per_page)
{
    $num_pages =1;
}
else if(($num_rows % $per_page)==0)
{
    $num_pages =($num_rows/$per_page) ;
}
else
{
    $num_pages =($num_rows/$per_page)+1;
    $num_pages = (int)$num_pages;
}
$row_end = $per_page * $page;
if($row_end > $num_rows)
{
    $row_end = $num_rows;
}
$sql .= " ORDER BY companyname ASC LIMIT $row_start ,$row_end ";
$query = mysqli_query($conn,$sql);
?>
<table width="600" border="1">
<tr>
<th width="91"> <div align="center">CustomerID </div></th>
<th width="98"> <div align="center">Name </div></th>
<th width="198"> <div align="center">location </div></th>
<th width="97"> <div align="center">review </div></th>
</tr>
<?php
 while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
 {
  ?>
 <tr>
<td><div align="center"><?php echo $result["member_id"];?></div></td>
<td><?php echo $result["companyname"];?></td>
<td><?php echo $result["location"];?></td>
<td><div align="center"><?php echo $result["reviewsubmission"];?></div></td>
 </tr>
 <?php
 }
  ?>
 </table>
  <br>
   Total <?php echo $num_rows;?> Record : <?php echo $num_pages;?> Page :
  <?php
  if($prev_page)
  {
     echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$prev_page&txtKeyword=$strKeyword'><< Back</a> ";
   }
 for($i=1; $i<=$num_pages; $i++){
  if($i != $page)
   {
    echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&txtKeyword=$strKeyword'>$i</a> ]";
 }
  else
  {
     echo "<b> $i </b>";
  }
  if($page!=$num_pages)
  {
    echo " <a href ='$_SERVER[SCRIPT_NAME]?P age=$next_page&txtKeyword=$strKeyword'>Next>></a> ";
  }
 $conn = null;
