Quote:
Originally Posted by k0nr4d
Untested, and assuming your regex is correct.
domain.com/collection.php?keyword=chicken|garlic
$keywords = explode("|",$_GET['keyword']);
foreach($keywords as $i) {
$output[] = "(?=.*".mysqli_real_escape_string($con,$i).")" ;
}
$result = mysqli_query($con,"SELECT * FROM Recipe WHERE Ingredient REGEXP '".implode("",$output)."' ORDER BY RAND() LIMIT 10");
|
Thank you.
That gives me something to work off, its tossing out a few SQL errors but I can get those fixed.
Appreciate the assistance
