Hey,
Open up a new PHP file and do it like this
Quote:
$mysqli = new mysqli("localhost","username","password","database ");
if ($mysqli -> connect_errno) {
echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
exit();
}
$data = mysqli_query($mysqli, "SELECT * FROM Recipe WHERE Ingredients REGEXP 'salt';");
while($result = mysqli_fetch_array($data)) {
//here goes the data
}
|
Let me know if this works. The main difference is how you connect to your db.
I just tried this on one of my scripts and it works like charm.
Also, in my case, using
was faster then
Tried it on a POS script I wrote for a few bars and restaurants in my town and here's the result
Quote:
SELECT * FROM `orders` WHERE `ordered_item` REGEXP 'cola';
Showing rows 0 - 24 (4683 total, Query took 0.0010 seconds.)
SELECT * FROM `orders` WHERE `ordered_item` LIKE '%cola%'
Showing rows 0 - 24 (4683 total, Query took 0.0007 seconds.)
|
Cheers,
z