Error in Comment Admin with MSSQL 2008 using 2.6.7 version,

Please report bugs here!

Moderator: Thorsten

Post Reply
williamm
Posts: 11
Joined: Sat Jul 31, 2010 5:37 pm

Error in Comment Admin with MSSQL 2008 using 2.6.7 version,

Post by williamm »

Hi,

I've just installed the phpMyFAQ version 2.6.7 in a Windows 2008 server using MSSQL 2008 and in Admin Page when I click in the Comments administration I get the following errors:

Comments administration

phpMyFAQ warning [2]: mssql_query() [function.mssql-query]: message: Incorrect syntax near the keyword 'user'. (severity 15) in C:\inetpub\wwwroot\faq\inc\PMF_DB\Mssql.php on line 94

phpMyFAQ warning [2]: mssql_query() [function.mssql-query]: Query failed in C:\inetpub\wwwroot\faq\inc\PMF_DB\Mssql.php on line 94

phpMyFAQ warning [2]: mssql_num_rows(): supplied argument is not a valid MS SQL-result resource in C:\inetpub\wwwroot\faq\inc\PMF_DB\Mssql.php on line 161

Best Regards,

William.
williamm
Posts: 11
Joined: Sat Jul 31, 2010 5:37 pm

Re: Error in Comment Admin with MSSQL 2008 using 2.6.7 version,

Post by williamm »

Just to complement my question, I've included a print $query in the mssql.php before the error line to check the syntax. The query is:

SELECT fc.id AS id, fc.lang AS lang, fc.parent_id AS parent_id, fc.name AS name, fc.description AS description, fc.user_id AS user_id FROM faqcategories fc LEFT JOIN faqcategory_group fg ON fc.id = fg.category_id LEFT JOIN faqcategory_user fu ON fc.id = fu.category_id GROUP BY fc.id, fc.lang, fc.parent_id, fc.name, fc.description, fc.user_id ORDER BY fc.id SELECT DISTINCT fc.id_comment AS comment_id, fc.id AS record_id, fcg.category_id, fc.usr AS user, fc.email AS email, fc.comment AS comment, fc.datum AS comment_date FROM faqcomments fc LEFT JOIN faqcategoryrelations fcg ON fc.id = fcg.record_id WHERE type = 'faq'

Regards,

William.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Error in Comment Admin with MSSQL 2008 using 2.6.7 version,

Post by Thorsten »

Hi William,

this fix should help you: http://github.com/thorsten/phpMyFAQ/com ... d0eb76bb33

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
williamm
Posts: 11
Joined: Sat Jul 31, 2010 5:37 pm

Re: Error in Comment Admin with MSSQL 2008 using 2.6.7 version,

Post by williamm »

Hi Thorsten,

After the patch in the both files, the message warning has changed to:

phpMyFAQ warning [2]: mssql_query() [function.mssql-query]: message: The text data type cannot be selected as DISTINCT because it is not comparable. (severity 16) in Mssql.php on line 94

phpMyFAQ warning [2]: mssql_query() [function.mssql-query]: Query failed in Mssql.php on line 94

phpMyFAQ warning [2]: mssql_num_rows(): supplied argument is not a valid MS SQL-result resource in Mssql.php on line 161

The query is:
SELECT fc.id AS id, fc.lang AS lang, fc.parent_id AS parent_id, fc.name AS name, fc.description AS description, fc.user_id AS user_id FROM faqcategories fc LEFT JOIN faqcategory_group fg ON fc.id = fg.category_id LEFT JOIN faqcategory_user fu ON fc.id = fu.category_id GROUP BY fc.id, fc.lang, fc.parent_id, fc.name, fc.description, fc.user_id ORDER BY fc.id SELECT DISTINCT fc.id_comment AS comment_id, fc.id AS record_id, fcg.category_id, fc.usr AS username, fc.email AS email, fc.comment AS comment, fc.datum AS comment_date FROM faqcomments fc LEFT JOIN faqcategoryrelations fcg ON fc.id = fcg.record_id WHERE type = 'faq'

Best Regards,

William.
williamm
Posts: 11
Joined: Sat Jul 31, 2010 5:37 pm

Re: Error in Comment Admin with MSSQL 2008 using 2.6.7 version,

Post by williamm »

Hello Thorsten,

Could you reproduce this new problem (after applying your fix)?

Best Regards,

William.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Error in Comment Admin with MSSQL 2008 using 2.6.7 version,

Post by Thorsten »

Hi,

could you please try this fix: http://github.com/thorsten/phpMyFAQ/com ... aa6fbef82a

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
williamm
Posts: 11
Joined: Sat Jul 31, 2010 5:37 pm

Re: Error in Comment Admin with MSSQL 2008 using 2.6.7 version,

Post by williamm »

Thorsten,

Now it shows the FAQ comments but there is still the error below:

phpMyFAQ notice [8]: Undefined property: stdClass::$user in Comment.php on line 327

Best Regards,

William.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Error in Comment Admin with MSSQL 2008 using 2.6.7 version,

Post by Thorsten »

Hi,

aaahhh.... :-)

Here's the fix: http://github.com/thorsten/phpMyFAQ/com ... 4d277b8c83

Thanks a lot for your patience!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
williamm
Posts: 11
Joined: Sat Jul 31, 2010 5:37 pm

Re: Error in Comment Admin with MSSQL 2008 using 2.6.7 version,

Post by williamm »

Perfect. Now everything it's OK.

Regards,

William.
Post Reply