'db->quote' not working

emilio@freedom2surf.net emilio@freedom2surf.net
Tue, 18 Sep 2001 12:25:47 +0000


Running latest cvs of horde/imp (18th sept.)

I am having problems with the sql.php file. (/horde/lib/Prefs/sql.php). 
using "db->quote" doesn't seem to be working, however when I change the code 
(see below), it all works fine. Any suggestions?

(I have had to change all code respectively)

Example of Original code

/* Build the SQL query. */
        $query = 'select pref_scope, pref_name, pref_value from ';
        $query .= $this->params['table'] . ' ';
        $query .= 'where pref_uid = ' . $this->db->quote($this->user);
        $query .= ' and (pref_scope = ' . $this->db->quote($this->scope);
        $query .= " or pref_scope = 'horde') order by pref_scope";

Example of hacked code

/* Build the SQL query. */
        $query = 'select pref_scope, pref_name, pref_value from ';
        $query .= $this->params['table'] . ' ';
        $query .= 'where pref_uid = \'' . $this->user .'\'';
        $query .= ' and (pref_scope = \'' . $this->scope . '\'';
        $query .= " or pref_scope = 'horde') order by pref_scope";


Paste of test.php

Horde Versions
Horde: 1.3.5-cvs 
IMP: 2.3.7-cvs 
Turba: 0.0.3-cvs 
PHP Version
View phpinfo() screen 
PHP Version: 4.0.6 
PHP Major Version: 4.0 
PHP Minor Version: 6 
PHP Version Classification: release 
You are running a supported version of PHP.
PHP Module Capabilities
FTP Support: No 
Gettext Support: Yes 
IMAP Support: Yes 
LDAP Support: No 
MCAL Support: No 
Mcrypt Support: Yes 
MySQL Support: Yes 
PostgreSQL Support: Yes 
XML Support: Yes 
Miscellaneous PHP Settings
magic_quotes_runtime set to Off: Yes 
PHP Sessions
Session counter: 1 
To unregister the session: click here 
PEAR
PEAR - Yes 
Mail::RFC822 - Yes 
Log - Yes 
DB - Yes 

Thanks in advanced,

Emilio

------------------------------------------------- 
Everyone should have http://www.freedom2surf.net/