Blog Image

mysql error while executing propel:insert-sql in symfony 1.4

[propel-sql-exec] SQLSTATE[42000]: Syntax error or access violation: 106 you have an error in your SQL syntax; check the manual that corresponds to you
server version for the right syntax to use near ‘Type=InnoDB’ at line 16
>> propel Running “insert-sql” phing task
[propel-sql-exec] Failed to execute:

CREATE TABLE `tblName`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`description` TEXT,
`image` VARCHAR(255),
`created_at` DATETIME,
PRIMARY KEY (`id`),
)Type=InnoDB

[propel-sql-exec] SQLSTATE[42000]: 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 ‘Type=InnoDB’ at line 16

Some problems occurred when executing the task:
If the exception message is not clear enough, read the output of the task for more information
>> file- D:/xampp/htdocs/s…1_4/config/generated-schema.xml

The solution to this is
Edit the file D:/xampp/htdocs/symfony_1_4/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/sql/mysql/MysqlDDLBuilder.php
Line 156, change
$script .= “Type=$mysqlTableType”;
to
$script .= “Engine=$mysqlTableType”;



Author: admin

Vinod Ram has been in Software Industry since 2006 and has experience of over 16 years in Software Development & Project Management domain specialised majorly in LAMP stack & Open Source Technology, building enterprise level Web based Application, Large Database driven and huge traffic Websites and Project Management. He loves to write information articles and blog to share his knowledge and experience with the outside world and help people to find solution for their problems.