Every time I create a chat room, I get the following error:

* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "last_cmid" at character 25 in /var/www/html/drupal-6.15-dev/includes/database.pgsql.inc on line 139.
* user warning: query: SELECT cc.*, n.title, 0 last_cmid, 0 msg_count, NULL last_msg FROM chatroom_chat cc INNER JOIN node n ON n.nid = cc.nid WHERE cc.crid = 194 in /var/www/html/drupal-6.15-dev/sites/all/modules/chatroom/chatroom.module on line 316.

I have uninstalled the modules and reinstalled, then I tried using the version 6.x-2.x-dev but still received this error. I was thinking that this module wasn't compatible with postgres, but there doesn't seem to be anyone saying anything about it.

I have followed the instructions step by step but still got this error. Has anyone else come across this error?

Comments

vesta54’s picture

I have the same error and errors in chat . I think that this request is only to mySQL

vesta54’s picture

Category: support » bug
Priority: Normal » Major

I have modified the source code in chatroom.module but i don't know why have you need "0 guest_id" ? Anyone have a idea ?

1/

function chatroom_chat_load_messages($chat_id, $last_cmid = 0, $limit = FALSE) {
  switch ($GLOBALS['db_type']) {
	case 'mysql':
    case 'mysqli':
		$sql = "SELECT cm.*, u.name, 0 guest_id
			  FROM {chatroom_msg} cm
			  INNER JOIN {users} u ON u.uid = cm.uid
			  WHERE cm.ccid = %d 
			  AND cm.cmid > %d 
			  ORDER BY cm.cmid ASC";
		break;
	case 'pgsql':
		$sql = "SELECT cm.*, u.name
			  FROM {chatroom_msg} cm
			  INNER JOIN {users} u ON u.uid = cm.uid
			  WHERE cm.ccid = %d 
			  AND cm.cmid > %d 
			  ORDER BY cm.cmid ASC";	
		break;
  }

2/

function chatroom_chat_load_latest_messages($node) {
  switch ($GLOBALS['db_type']) {
	case 'mysql':
    case 'mysqli':
		$sql = "SELECT cm.*, u.name, 0 guest_id
			  FROM {chatroom_msg} cm
			  INNER JOIN {users} u ON u.uid = cm.uid
			  WHERE cm.ccid = %d 
			  ORDER BY cm.cmid DESC
			  LIMIT %d";
		break;
	case 'pgsql':
		$sql = "SELECT cm.*, u.name
			  FROM {chatroom_msg} cm
			  INNER JOIN {users} u ON u.uid = cm.uid
			  WHERE cm.ccid = %d 
			  ORDER BY cm.cmid DESC
			  LIMIT %d";
		break;
  }

3/

function chatroom_load_chats($nid) {
  $chats = array();
  $cmids = array();
  switch ($GLOBALS['db_type']) {
	case 'mysql':
    case 'mysqli':
		$sql = "SELECT cc.*, n.uid, n.title, 0 last_cmid, 0 msg_count, NULL last_msg
			  FROM {chatroom_chat} cc
			  INNER JOIN {node} n ON n.nid = cc.nid
			  WHERE cc.crid = %d";
		break;
	case 'pgsql':
		$sql = "SELECT cc.*, n.uid, n.title
			  FROM {chatroom_chat} cc
			  INNER JOIN {node} n ON n.nid = cc.nid
			  WHERE cc.crid = %d";
		break;
  }

but i have error in my log file :
[18-Aug-2010 15:29:12] PHP Warning: require_once(./sites/all/modules/chatroom/chatroom.cache.apc.inc) [function.require-once]: failed to open stream: No such file or directory in D:\Logiciels\wamp\www\drupal6_16\chatroomread.php on line 77

[18-Aug-2010 15:29:12] PHP Fatal error: require_once() [function.require]: Failed opening required './sites/all/modules/chatroom/chatroom.cache.apc.inc' (include_path='.;C:\php5\pear') in D:\Logiciels\wamp\www\drupal6_16\chatroomread.php on line 77

[18-Aug-2010 15:29:12] PHP Warning: require_once(./sites/all/modules/chatroom/chatroom.cache.apc.inc) [function.require-once]: failed to open stream: No such file or directory in D:\Logiciels\wamp\www\drupal6_16\chatroomread.php on line 77

[18-Aug-2010 15:29:12] PHP Fatal error: require_once() [function.require]: Failed opening required './sites/all/modules/chatroom/chatroom.cache.apc.inc' (include_path='.;C:\php5\pear') in D:\Logiciels\wamp\www\drupal6_16\chatroomread.php on line 77

[18-Aug-2010 15:29:12] PHP Warning: require_once(./sites/all/modules/chatroom/chatroom.cache.apc.inc) [function.require-once]: failed to open stream: No such file or directory in D:\Logiciels\wamp\www\drupal6_16\chatroomread.php on line 77

[18-Aug-2010 15:29:12] PHP Fatal error: require_once() [function.require]: Failed opening required './sites/all/modules/chatroom/chatroom.cache.apc.inc' (include_path='.;C:\php5\pear') in D:\Logiciels\wamp\www\drupal6_16\chatroomread.php on line 77

[18-Aug-2010 15:29:12] PHP Warning: require_once(./sites/all/modules/chatroom/chatroom.cache.apc.inc) [function.require-once]: failed to open stream: No such file or directory in D:\Logiciels\wamp\www\drupal6_16\chatroomread.php on line 77

[18-Aug-2010 15:29:12] PHP Fatal error: require_once() [function.require]: Failed opening required './sites/all/modules/chatroom/chatroom.cache.apc.inc' (include_path='.;C:\php5\pear') in D:\Logiciels\wamp\www\drupal6_16\chatroomread.php on line 77

[18-Aug-2010 15:29:22] PHP Warning: require_once(./sites/all/modules/chatroom/chatroom.cache.apc.inc) [function.require-once]: failed to open stream: No such file or directory in D:\Logiciels\wamp\www\drupal6_16\chatroomread.php on line 77

[18-Aug-2010 15:29:22] PHP Fatal error: require_once() [function.require]: Failed opening required './sites/all/modules/chatroom/chatroom.cache.apc.inc' (include_path='.;C:\php5\pear') in D:\Logiciels\wamp\www\drupal6_16\chatroomread.php on line 77

And this module don't work with IE