Re: [PHP-DB] SELECT problem between MySQL 3.23 and MySQL 4

2004-07-02 Thread John W. Holmes
Chris Payne wrote:
  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:
[snip]
LENGTH(REPLACE(LOWER(def),LOWER('as'),''))) 
[snip]
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'
This is not a MySQL 3 vs. MySQL4 issue. If it was, this is the wrong 
list, anyhow.

Take a look at the line of the query you _say_ you're running that I've 
included above and take a look at the last line of the error that you're 
getting from MySQL.

See the difference? Good... now troubleshoot.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] SELECT problem between MySQL 3.23 and MySQL 4

2004-07-01 Thread Chris Payne
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 relevance0 
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