[SOLVED] 1064 error

Questions related to the configuration of Joomla, Templates, and Security related questions/issues
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Tue Apr 23, 2013 6:41 pm
After a few hours searching for a solution, debugging the code and analyzing all the sql's generated by page, I found a solution to a common problem that many users have reported here in the forums.
The 1064 error indicates that there is an error in the syntax of SQL (when running in server database).
This happened to me after installing the template and delete some k2 items that already came in demo version. Turns out there were some modules mod_news_pro_gk4 that were configured to display those items in particular (listing the items by their ids separated by comma).
Thus such articles were excluded, the return of a SQL queries was empty, whereas in the assembly of SQL code was expected a list of content.id.
Thus the generated SQL was a stretch malformed ("AND ())."
To solve the problem, I changed the file "/modules/mod_news_pro_gk4/gk_classes/gk.source.k2.php" on line 381 (approximate):
was:
Code: Select all
$ sql_where = '';

Changed to:
Code: Select all
$sql_where = (count($ids) > 0) ? '' : 'false'
User avatar
Fresh Boarder

GK User
Tue Apr 23, 2013 7:39 pm
I'm sorry, I forgot one important detail.

was:
Code: Select all
         $sql_where = '';
         $ids = $content['ID'];


Changed to:
Code: Select all
         $ids = $content['ID'];
         $sql_where = (count($ids) > 0) ? '' : 'false';
User avatar
Fresh Boarder

GK User
Sat Apr 27, 2013 11:16 am
Awesome job bro! many thanks!
User avatar
Fresh Boarder

teitbite
Sat May 11, 2013 5:25 pm
Hi

Thank You for that. I'm closing this thread now.
User avatar
Moderator


cron