Module Guestbook

General project discussion. NOT for help questions.
Post Reply
maaca
New Member
New Member
Posts: 6
Joined: Sun Oct 28, 2007 9:02 am

Module Guestbook

Post by maaca »

Hi,
I have moved site to an another hosting and also I have changed DB from MySQL to Postgresql 8. But I have this problem with guestbook now. I installed it and everything looked ok, until I tried to show guestbook in my site. There occurred this error

Code: Select all

Fatal error: Call to a member function FetchRow() on a non-object in /mnt/data/accounts/o/oobturnov/data/www/modules/Guestbook/lib/classes/module/class.GuestbookFrontend.php on line 400
Have you any idea how to resolve this problem. I compare the line 400 with the old version (old web hosting) and it is same.
Thank you
 
tobik
Translator
Translator
Posts: 149
Joined: Thu Aug 16, 2007 6:18 pm

Re: Module Guestbook

Post by tobik »

Please can you verify that this statement is executed without error from PostgreSQL

Code: Select all

SELECT COUNT(*) AS total FROM cms_module_guestbook WHERE approved='1'
Adapt "cms_" to your own CMS-DB-Prefix.
maaca
New Member
New Member
Posts: 6
Joined: Sun Oct 28, 2007 9:02 am

Re: Module Guestbook

Post by maaca »

Hello,
I verified it. I tried it with phpPgAdmin and I also made user_tag with this query. Both were correct and result was 0.
tobik
Translator
Translator
Posts: 149
Joined: Thu Aug 16, 2007 6:18 pm

Re: Module Guestbook

Post by tobik »

Oups. Sorry, wrong statement. Please insert a line with

Code: Select all

		print $query;
just before your line 400

Code: Select all

		$result =& $this->db->Execute($query);
In the frontend guestbook you will see the relevant SQL command. Would you please verify that? Thanks.
maaca
New Member
New Member
Posts: 6
Joined: Sun Oct 28, 2007 9:02 am

Re: Module Guestbook

Post by maaca »

Ok. So print $query

Code: Select all

SELECT * FROM cms_module_guestbook WHERE approved='1' ORDER BY date DESC LIMIT 0,15
and when I send this query with phpPgAdmin it occurred this error

Code: Select all

ERROR:  LIMIT #,# syntax is not supported
HINT:  Use separate LIMIT and OFFSET clauses.
tobik
Translator
Translator
Posts: 149
Joined: Thu Aug 16, 2007 6:18 pm

Re: Module Guestbook

Post by tobik »

Would you change line 393 from

Code: Select all

$query = 'SELECT * FROM ' . cms_db_prefix() . "module_guestbook WHERE approved='1' ORDER BY date " . ($sortasc ? 'ASC' : 'DESC') . " LIMIT $index,$limit";
to

Code: Select all

$query = 'SELECT * FROM ' . cms_db_prefix() . "module_guestbook WHERE approved='1' ORDER BY date " . ($sortasc ? 'ASC' : 'DESC') . " LIMIT $limit OFFSET $index";
Does it work?
maaca
New Member
New Member
Posts: 6
Joined: Sun Oct 28, 2007 9:02 am

Re: Module Guestbook

Post by maaca »

Yes, I already did it and it works correctly now. Thanks a lot.
tobik
Translator
Translator
Posts: 149
Joined: Thu Aug 16, 2007 6:18 pm

Re: Module Guestbook

Post by tobik »

Thanks, I have put it in the SVN
Last edited by tobik on Fri Feb 15, 2008 6:31 pm, edited 1 time in total.
Post Reply

Return to “General Discussion”