Page 1 of 1
Module Guestbook
Posted: Thu Feb 14, 2008 9:15 am
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
Re: Module Guestbook
Posted: Thu Feb 14, 2008 10:22 am
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.
Re: Module Guestbook
Posted: Thu Feb 14, 2008 4:01 pm
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.
Re: Module Guestbook
Posted: Thu Feb 14, 2008 7:18 pm
by tobik
Oups. Sorry, wrong statement. Please insert a line with
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.
Re: Module Guestbook
Posted: Thu Feb 14, 2008 9:27 pm
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.
Re: Module Guestbook
Posted: Thu Feb 14, 2008 9:38 pm
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?
Re: Module Guestbook
Posted: Fri Feb 15, 2008 12:22 pm
by maaca
Yes, I already did it and it works correctly now. Thanks a lot.
Re: Module Guestbook
Posted: Fri Feb 15, 2008 6:19 pm
by tobik
Thanks, I have put it in the SVN