multiple field search
Hi guys and gals-
I am trying to make a search that search multiple fields ( firstname and lastname in a table.
This is the code I have right now that works, but when I try to add "AND" or "OR" things don't function
<?php
$colname_Recordset1 = "-1";
if (isset($_POST['search'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_POST['search'] : addslashes($_POST['search']);
}
mysql_select_db($database_dot, $dot);
$query_Recordset1 = sprintf("SELECT * FROM dmd WHERE lastname = '%s'", $colname_Recordset1);
$Recordset1 = mysql_query($query_Recordset1, $dot) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
Thanks in Advance
|