MySQLi Search Contain Keyword
Hi there, (with the help of Ray) I have managed to get a a product name search via MySQLi recordset...However what its currently doing is matching the URL value to the database value...in otherwords it only checks exact matches.....what I would like to do is the search box checks for the value to "contain".....for example a customer enters into the search box: ARMCHAIR ...but what I would like it to do is return all database records containing CHAIR..
Here is the currently MySQLi recordset:
if (isset($_GET["Product"])) {
$productName = $_GET["Product"];
$rsProducts->addFilter("ProductName","=","s",$productName);
}
and the form im using:
<form>
<input name="Department" type="hidden" id="Department" value="Search">
<input type="text" name="Product" value=""><input type="submit">
</form>
I have looked up on Google, and found things like incorporating php such as STRPOS and PREG_MATCH, however Im a little hazy in understanding how I would put this into my PHP recordset?
Any help would be appriciated :)
Chris