PDA

View Full Version : SQL Error when applying auto_main_red theme



Mike Gholson
February 23, 2013, 05:24 AM
Hi guys, I tried applying the new auto main red theme and it breaks my site. I can't get back into the admin panel or the site unless I totally delete the entire theme directory. Here's the error I see. My site is: datsunclassifieds.com



MYSQL ERROR
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Query: INSERT INTO `fl4_lang_keys` (`Code`, `Module`, `Key`, `Value`) VALUES
Function: error
Class: rlDb
File: /var/www/vhosts/datsunclassifieds.com/flynax/includes/classes/rlDb.class.php (line# 193)

Maaz Surchy
February 23, 2013, 10:00 AM
I have issue on image upload, and had some sql errors, but found them.

In category filter, I had City field which was "textarea" and I had deleted it from listing field. So the category filter was enabled on front end and it refered to some SQL error with name City field. I had created a new City field with dropdown list. So I replaced the City field on category filter everything works great, but still have image uploading issue.

Maybe you have something with Multifield or Category filter too....

Mike Gholson
February 23, 2013, 08:33 PM
Thanks for the idea, I'll give it a try

Mike Gholson
February 24, 2013, 02:45 AM
Looks like I have some multi-category fields as well. I'll need to ask the programmers to help me out with it. I like the theme.

Dmitry
February 25, 2013, 03:52 AM
Hello Guys,


Hi guys, I tried applying the new auto main red theme and it breaks my site. I can't get back into the admin panel or the site unless I totally delete the entire theme directory. Here's the error I see. My site is: datsunclassifieds.com

FTP > templates > auto_main_red > settings.tpl.php - and open:
You need to find the code:


/* insert template phrases */
if ( version_compare($config['rl_version'], '4.1.0') <= 0 )
{
$sql = "INSERT INTO `". RL_DBPREFIX ."lang_keys` (`Code`, `Module`, `Key`, `Value`) VALUES ";
foreach ($languages as $language)
{
foreach ($tpl_phrases as $tpl_phrase)
{
if ( !$rlDb -> getOne('ID', "`Code` = '{$language['Code']}' AND `Key` = '{$tpl_phrase[1]}'", 'lang_keys') )
{
$sql .= "('{$language['Code']}', '{$tpl_phrase[0]}', '{$tpl_phrase[1]}', '{$tpl_phrase[2]}'), ";
}
}
}
$sql = rtrim($sql, ', ');
$rlDb -> query($sql);
}


and replace on it



/* insert template phrases */
if ( version_compare($config['rl_version'], '4.1.0') <= 0 )
{
$sql = "INSERT INTO `". RL_DBPREFIX ."lang_keys` (`Code`, `Module`, `Key`, `Value`) VALUES ";
$test = 0;
foreach ($languages as $language)
{
foreach ($tpl_phrases as $tpl_phrase)
{
if ( !$rlDb -> getOne('ID', "`Code` = '{$language['Code']}' AND `Key` = '{$tpl_phrase[1]}'", 'lang_keys') )
{
$test = 1;
$sql .= "('{$language['Code']}', '{$tpl_phrase[0]}', '{$tpl_phrase[1]}', '{$tpl_phrase[2]}'), ";
}
}
}
$sql = rtrim($sql, ', ');
if($test)
{
$rlDb -> query($sql);
}
}


It is all.
Thanks.

Geoffrey Doohan
May 6, 2013, 01:57 AM
Thx Dmitry ... worked for me :)