I am getting Syntax error or access violation: 1064

Avatar
  • Answered
hi I ma getting error in magento
Syntax error or access violation: 1064 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 '{{db_prefix}}imageslider (
`imageslider_id` int(11) unsigned NOT NULL auto_in' at line 1
and below is my code
$installer->run("
-- DROP TABLE IF EXISTS {$this->getTable('imageslider')};
CREATE TABLE {$this->getTable('imageslider')} (
`imageslider_id` int(11) unsigned NOT NULL auto_increment,
`title` varchar(255) NOT NULL default '',
`link` varchar(255) NOT NULL default '',
`image` varchar(255) NOT NULL default '',
`effect` varchar(255) NOT NULL default '',
`description` text NOT NULL default '',
`stores` varchar(255) NOT NULL default '0',
`order` smallint(6) NOT NULL default '0',
`status` smallint(6) NOT NULL default '0',
`created_time` datetime NULL,
`update_time` datetime NULL,
PRIMARY KEY (`imageslider_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
Avatar
Arn
Hello,

Sorry for the problem with the MySQL error with your Magento installation. The error message up top pretty much explains the issue. Your MySQL code does not appear to be specifying the table correctly, so an error message is appearing stating: '{{db_prefix}}imageslider. So MySQL runs through the query and cannot identify the table prefix leading to the error. We cannot provide a code fix for you, so you may need to speak to a developer or programmer in order to fix the code - if you are not coder yourself.

I hope this helps to answer your question, please let us know if you require any further assistance.

Regards,
Arnel C.