title: How can I combine 2 columns in sql table to search for full names
body: <blockquote>
    <p>I have a mySQL database with a FirstName and LastName column and presently i have a search query searching for Lastnames, and When the LastNames match they are echoed on screen along with the FirstName from it's row, Now thats great, what i will like to find out is how can a make the query search for FullNames that are typed into the input feild, keep in mind that i do not have a FullName column the full name will be what the user types in, bellow is an example of what I presently have working! Thanks.</p>
  </blockquote>
  
  <pre><code>if(isset($_GET['name'])){   
      $raw_name=$_GET['name'];
  
      if(preg_match("/[A-Z | a-z]+/", $raw_name)){        
          $name=$raw_name;        
          include "connect.php";      
          //-query the database table
          $sql="SELECT userId, FirstName, LastName FROM residential2 WHERE FirstName='" . $name   ."'";
          //-run the query against the mysql query function
          $result=mysql_query($sql);
          //-count results
          $numrows=mysql_num_rows($result);
  
          echo "&lt;div align=\"center\"&gt;" . $numrows . " results found for " . stripslashes($name) . "&lt;/div&gt;";
  
          while($row=mysql_fetch_array($result)){         
              $FirstName =$row['FirstName'];
              $LastName=$row['LastName'];
              $userId=$row['userId']; 
              //-display the result of the array
              echo "&lt;ul&gt;\n"; 
              echo "&lt;li&gt;" . "&lt;a href=\"index.php?id=$userId\"&gt;" . $LastName . " "  .$FirstName . "   &lt;/a&gt;&lt;/li&gt;\n";
              echo "&lt;/ul&gt;";
          }
      }
      else {      
          echo "&lt;p&gt;Please enter a search query&lt;/p&gt;";
      }
  }
  </code></pre>