"Invalid SQL" error cause

Hugh Hinskens hinskens@camosun.bc.ca
Thu, 19 Oct 2000 19:39:22 -0700 (PDT)


Re: IMP v.2.2.3, PHP v.4.0.3pl1, Horde v.1.2.0-pre14 

After spending many hours trying to determine the reason for the following 
error (including searching the horde mailing list archives):

Database error (HordeDB): Invalid SQL: SELECT val FROM active_sessions WHERE 
sid = '216e0eb6a19e7a6f35ca10702087d46e' AND name = 'HordeSession'
Database error (HordeDB): next_record called with no query pending.
Database error (HordeDB): Invalid SQL: update active_sessions set 
val='base64:JHRoaXMtPmluID0gJyc7ICR0aGlzLT5wdCA9IGFycmF5KCk7IA==', 
changed='20001019184439' where sid='216e0eb6a19e7a6f35ca10702087d46e' and 
name='HordeSession'

I finally found the reason. The line indicating $Database below in "local.inc" 
was set to 'imp' instead of 'horde'. Although I'm not sure as I've been hacking 
everything so much in a desperate attempt to resolve this problem, I believe it 
was set to 'imp' for a previous version of IMP. 

/* To use an SQL database, uncomment and edit the following: */
class HordeDB extends DB_Sql {
  var $Host = 'localhost';
  var $Database = 'horde';
  var $User = 'impmgr';
  var $Password = ''xxxxxx';
  var $Port = '';

Unfortunately, the error message gives no indication that this might be the 
problem. I noticed there were many messages in the archives mentioning this 
problem and it is distinct from the "mysql/freeze" problem. Hope this helps 
somebody avoid the excrutiating nightmare I went through to discover this 
problem.

Regards,