<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Agence de Développement Informatique du Nord &#187; Propel</title>
	<atom:link href="http://blog.adin.pro/tag/propel/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.adin.pro</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Thu, 26 Dec 2019 08:54:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>Symfony 1.x propel-insert-sql   [propel-sql-exec] SQLSTATE[42000]: Syntax error or access violation: 1064</title>
		<link>http://blog.adin.pro/2013-03-01/symfony-1-x-propel-insert-sql-propel-sql-exec-sqlstate42000-syntax-error-or-access-violation-1064/</link>
		<comments>http://blog.adin.pro/2013-03-01/symfony-1-x-propel-insert-sql-propel-sql-exec-sqlstate42000-syntax-error-or-access-violation-1064/#comments</comments>
		<pubDate>Fri, 01 Mar 2013 09:43:03 +0000</pubDate>
		<dc:creator><![CDATA[blogadmin]]></dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Propel]]></category>

		<guid isPermaLink="false">http://blog.adin.pro/?p=120</guid>
		<description><![CDATA[<p>You are using a old version of symfony 1.x on a new version of mysql and when you try to insert the model on your database you get this error : [propel-sql-exec] SQLSTATE[42000]: Syntax error or access violation: 1064 You &#8230; <a href="http://blog.adin.pro/2013-03-01/symfony-1-x-propel-insert-sql-propel-sql-exec-sqlstate42000-syntax-error-or-access-violation-1064/">Continue reading <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="http://blog.adin.pro/2013-03-01/symfony-1-x-propel-insert-sql-propel-sql-exec-sqlstate42000-syntax-error-or-access-violation-1064/">Symfony 1.x propel-insert-sql   [propel-sql-exec] SQLSTATE[42000]: Syntax error or access violation: 1064</a> appeared first on <a rel="nofollow" href="http://blog.adin.pro">Agence de Développement Informatique du Nord</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>You are using a old version of symfony 1.x on a new version of mysql and when you try to insert the model on your database you get this error :</p>
<p>[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 &#8216;Type=InnoDB&#8217; at line 6</p>
<p>The problem come from this query</p>
<pre class="brush: bash; title: ; notranslate">
CREATE TABLE `pret_externe_type`
 (
 `id_pret_externe_type` BIGINT(20)  NOT NULL AUTO_INCREMENT,
 `libelle` VARCHAR(100)  NOT NULL,
 PRIMARY KEY (`id_pret_externe_type`)
 )Type=InnoDB
</pre>
<p>Mysql do not use &#8220;Type=&#8221; option anymore, you have to replace it by &#8220;Engine=&#8221;</p>
<pre class="brush: bash; title: ; notranslate">
CREATE TABLE `pret_externe_type`
 (
 `id_pret_externe_type` BIGINT(20)  NOT NULL AUTO_INCREMENT,
 `libelle` VARCHAR(100)  NOT NULL,
 PRIMARY KEY (`id_pret_externe_type`)
 )Engine=InnoDB
</pre>
<p>To fix it the code, on symfony 1.2 go on this file /lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/sql/mysql/MysqlDDLBuilder.php and change the line 156<br />
from</p>
<pre class="brush: php; title: ; notranslate">
 $script .= &quot;Type=$mysqlTableType&quot;;
</pre>
<p>to </p>
<pre class="brush: php; title: ; notranslate">
 $script .= &quot;Engine=$mysqlTableType&quot;;
</pre>
<p>On symfony 1.4, you have to change this file : lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/sql/mysql/MysqlDDLBuilder.php<br />
Always on ligne 156</p>
<p>After code change, rebuild your SQL model and insert it to your databases</p>
<pre class="brush: bash; title: ; notranslate">
php symfony propel-build-sql
php symfony propel-insert-sql
</pre>
<p>The post <a rel="nofollow" href="http://blog.adin.pro/2013-03-01/symfony-1-x-propel-insert-sql-propel-sql-exec-sqlstate42000-syntax-error-or-access-violation-1064/">Symfony 1.x propel-insert-sql   [propel-sql-exec] SQLSTATE[42000]: Syntax error or access violation: 1064</a> appeared first on <a rel="nofollow" href="http://blog.adin.pro">Agence de Développement Informatique du Nord</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adin.pro/2013-03-01/symfony-1-x-propel-insert-sql-propel-sql-exec-sqlstate42000-syntax-error-or-access-violation-1064/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
