Hi There!
I'm writing a very basic search script. I have a form field where I want to accept both first and last names. In my database, the first and last names are in separate fields. I want the query to go through both fields and come up with results. Here is the PHP code so far (only searches first name):
$search = $_POST['search'];
$data = mysql_query("SELECT * FROM customers WHERE fname LIKE'%$search%'");
//Display results
while($result = mysql_fetch_array($data))
{
echo $result['fname'];
echo " ";
echo $result['lname'];
echo "<br>";
}
How can i change this around to perform the way I need?
Thanks in advance!