php-db | 2004071

[PHP-DB] SELECT problem between MySQL 3.23 and MySQL 4 From: Chris Payne (chris_payne <email protected>)
Date: 07/01/04

Hi there everyone,

 

I'm using Booleans in my searches (New to it) but it works perfectly on my
local 3.23 version of MySQL, but on the main server which uses version 4 of
MySQL I get an error so there's an error in my Syntax. Here's what I
currently use:

 

SELECT id, def, word,
0.2*(
LENGTH(word) -
LENGTH(REPLACE(LOWER(word),LOWER('as'),'')))
/LENGTH('as') + 0.2*(
LENGTH(def) -
LENGTH(REPLACE(LOWER(def),LOWER('as'),'')))
/LENGTH('as') as relevance
FROM joyzine.dictionary
WHERE
( word LIKE '%as%' OR def LIKE '%as%' )
HAVING relevance>0
ORDER BY relevance DESC

 

And here's the error I receive on the remote MySQL 4 server:

 

Warning: Bad arguments to implode() in
/var/www/html/www.planetoxygene.com/htdocs/funcs_mysql_boolean.php on line
45
You have an error in your SQL syntax. Check the manual that corresponds to
your MySQL server version for the right syntax to use near ') -
LENGTH(REPLACE(LOWER(),LOWER('as'),''))) /LENGTH('as'

 

Can anyone see what is wrong which is stopping it being compatible with
MySQL 4?

 

Any help would really be appreciated, as this system is very important.

 

Best Wishes

 

Chris