title: Multiple Search Pagination with PHP and MySQL
body: <p>I have the following query below which uses the <code>GET</code> value of <code>fname</code> and <code>lname</code> to compare it to a database table: </p>
  
  <pre><code>$query = mysql_query("SELECT * FROM pages
                        WHERE `fname` = '$fname' OR `lname` = '$lname'
                        LIMIT $start, $perpage")
           or die(mysqli_error());
  </code></pre>
  
  <p>When I run the code, it only puts into account the <code>'lname' = '$lname'</code> statement. </p>
  
  <p>What I would like it to do is search for either the <code>fname</code> or <code>lname</code> variables, or both if they both of them are set.</p>