Code: Select all
$result = mysql_query ("SELECT * FROM products WHERE pause = 'off' AND deleted = 'no' AND (title LIKE '% ".$search." %' OR description LIKE '% ".$search." %' OR id = '$search') LIMIT $offset, $rowsPerPage") or die (mysql_error());
I've been told this will query the fields and force a space either side of the $variable. So it looks only for whole words, not 'car' in 'carry'.
Yet I get no results. Or if I do is as
Code: Select all
$result = mysql_query ("SELECT * FROM trimex_products WHERE pause = 'off' AND deleted = 'no' AND (title LIKE "% ".$search." %" OR description LIKE "% ".$search." %" OR id = '$search') LIMIT $offset, $rowsPerPage") or die (mysql_error());
Then I get
[text]Warning: Division by zero in C:\xampp\phpMyAdmin\site\includes\search.inc on line 30
Warning: Division by zero in C:\xampp\phpMyAdmin\site\includes\search.inc on line 30
Warning: Division by zero in C:\xampp\phpMyAdmin\site\includes\search.inc on line 30
Warning: Division by zero in C:\xampp\phpMyAdmin\site\includes\search.inc on line 30
Query was empty
[/text]
I've never been that good at the dots between variables. So does anyone know what I've done wrong here please?