Code: Select all
<form id="form1" name="form1" method="GET" action="search.php">
<table width="270" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="Product" type="text" size="32"/></td>
<td><input type="submit" name="button" id="button" value="SEARCH" /></td>
</tr>
</table>
</form>i need the results to search 3 columns in the database and return the results. I have set up search to search just one column but cant get multiple columns to work
here is what i have so far in the results page
the table is called LOTTIE_products and i want to search columns called "Product", "Product" and one that isnt in the SQL at present that i will add when i get it working is ""colour"
$var1_rsSearch = "-1";
if (isset($_GET['searchID'])) {
$var1_rsSearch = $_GET['searchID'];
}
mysql_select_db($database_lotties, $lotties);
$query_rsSearch = sprintf("SELECT * FROM LOTTIE_products WHERE LOTTIE_products.Product LIKE %s AND LOTTIE_products.`Description` LIKE %s", GetSQLValueString("%" . $var1_rsSearch . "%", "text"),GetSQLValueString("%" . $var1_rsSearch . "%", "text"));
$rsSearch = mysql_query($query_rsSearch, $lotties) or die(mysql_error());
$row_rsSearch = mysql_fetch_assoc($rsSearch);
$totalRows_rsSearch = mysql_num_rows($rsSearch);