SELECT problem between MySQL 3.23 and MySQL 4

From: Date: Fri, 02 Jul 2004 02:26:21 +0000
Subject: SELECT problem between MySQL 3.23 and MySQL 4
Groups: php.db 
Request: Send a blank email to php-db+get-35088@lists.php.net to get a copy of this message
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

« previous php.db (#35088) next »