<?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>[schuchlenz.com] &#187; update</title>
	<atom:link href="http://www.schuchlenz.com/tag/update/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.schuchlenz.com</link>
	<description>posts.each do { &#124;p&#124; read(p) }</description>
	<lastBuildDate>Thu, 25 Feb 2010 13:25:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Doing UPDATE with Doctrine and a String as Parameter</title>
		<link>http://www.schuchlenz.com/doing-update-with-doctrine-and-a-string-as-parameter/</link>
		<comments>http://www.schuchlenz.com/doing-update-with-doctrine-and-a-string-as-parameter/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 10:55:13 +0000</pubDate>
		<dc:creator>Stefan Schuchlenz</dc:creator>
				<category><![CDATA[Tech Stuff]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[getSql]]></category>
		<category><![CDATA[quotes]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://www.schuchlenz.com/doing-update-with-doctrine-and-a-string-as-parameter/</guid>
		<description><![CDATA[Today I had to extend a few Doctrine queries and one of these modifications consisted of changing the parameter of an UPDATE query from integer to string &#8211; and whoops! It didn&#8217;t work anymore&#8230;
When using $query-&#62;getSql(); I noticed that it wanted to do something like this:
UPDATE data SET date = 2009-12-14 WHERE ...
and of course [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to extend a few <a href="http://www.schuchlenz.com/tag/doctrine/" class="st_tag internal_tag" rel="tag" title="Posts tagged with doctrine">Doctrine</a> queries and one of these modifications consisted of changing the parameter of an <a href="http://www.schuchlenz.com/tag/update/" class="st_tag internal_tag" rel="tag" title="Posts tagged with update">UPDATE</a> query from integer to <a href="http://www.schuchlenz.com/tag/string/" class="st_tag internal_tag" rel="tag" title="Posts tagged with string">string</a> &#8211; and whoops! It didn&#8217;t work anymore&#8230;</p>
<p>When using <code>$query-&gt;<a href="http://www.schuchlenz.com/tag/getsql/" class="st_tag internal_tag" rel="tag" title="Posts tagged with getSql">getSql</a>();</code> I noticed that it wanted to do something like this:</p>
<p><code><a href="http://www.schuchlenz.com/tag/update/" class="st_tag internal_tag" rel="tag" title="Posts tagged with update">UPDATE</a> data SET date = 2009-12-14 WHERE ...</code></p>
<p>and of course mySQL doesn&#8217;t like passing date strings without proper <a href="http://www.schuchlenz.com/tag/quotes/" class="st_tag internal_tag" rel="tag" title="Posts tagged with quotes">quotes</a>&#8230;</p>
<p>The query looked like this:</p>
<p><code>$query-&gt;<a href="http://www.schuchlenz.com/tag/update/" class="st_tag internal_tag" rel="tag" title="Posts tagged with update">UPDATE</a>('Data')-&gt;set('date', $myNewDate)-&gt;where(...)</code></p>
<p>which I had to subsitute with</p>
<p><code>$query-&gt;<a href="http://www.schuchlenz.com/tag/update/" class="st_tag internal_tag" rel="tag" title="Posts tagged with update">UPDATE</a>('Data')-&gt;set('date', '?', $myNewDate)-&gt;where(...)</code></p>
<p>Note the <code>'?'</code> in the middle &#8211; now it works <img src='http://www.schuchlenz.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share this on:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.schuchlenz.com%2Fdoing-update-with-doctrine-and-a-string-as-parameter%2F&amp;partner=sociable" title="Print"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.schuchlenz.com%2Fdoing-update-with-doctrine-and-a-string-as-parameter%2F&amp;title=Doing%20UPDATE%20with%20Doctrine%20and%20a%20String%20as%20Parameter&amp;bodytext=Today%20I%20had%20to%20extend%20a%20few%20Doctrine%20queries%20and%20one%20of%20these%20modifications%20consisted%20of%20changing%20the%20parameter%20of%20an%20UPDATE%20query%20from%20integer%20to%20string%20-%20and%20whoops%21%20It%20didn%27t%20work%20anymore...When%20using%20%24query-%26gt%3BgetSql%28%29%3B%20I%20noticed%20that%20it%20wanted%20" title="Digg"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.schuchlenz.com%2Fdoing-update-with-doctrine-and-a-string-as-parameter%2F&amp;title=Doing%20UPDATE%20with%20Doctrine%20and%20a%20String%20as%20Parameter&amp;notes=Today%20I%20had%20to%20extend%20a%20few%20Doctrine%20queries%20and%20one%20of%20these%20modifications%20consisted%20of%20changing%20the%20parameter%20of%20an%20UPDATE%20query%20from%20integer%20to%20string%20-%20and%20whoops%21%20It%20didn%27t%20work%20anymore...When%20using%20%24query-%26gt%3BgetSql%28%29%3B%20I%20noticed%20that%20it%20wanted%20" title="del.icio.us"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.schuchlenz.com%2Fdoing-update-with-doctrine-and-a-string-as-parameter%2F&amp;t=Doing%20UPDATE%20with%20Doctrine%20and%20a%20String%20as%20Parameter" title="Facebook"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.schuchlenz.com%2Fdoing-update-with-doctrine-and-a-string-as-parameter%2F&amp;title=Doing%20UPDATE%20with%20Doctrine%20and%20a%20String%20as%20Parameter&amp;annotation=Today%20I%20had%20to%20extend%20a%20few%20Doctrine%20queries%20and%20one%20of%20these%20modifications%20consisted%20of%20changing%20the%20parameter%20of%20an%20UPDATE%20query%20from%20integer%20to%20string%20-%20and%20whoops%21%20It%20didn%27t%20work%20anymore...When%20using%20%24query-%26gt%3BgetSql%28%29%3B%20I%20noticed%20that%20it%20wanted%20" title="Google Bookmarks"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="javascript:AddToFavorites();" title="Add to favorites"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/addtofavorites.png" title="Add to favorites" alt="Add to favorites" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Doing%20UPDATE%20with%20Doctrine%20and%20a%20String%20as%20Parameter&amp;body=http%3A%2F%2Fwww.schuchlenz.com%2Fdoing-update-with-doctrine-and-a-string-as-parameter%2F" title="email"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.schuchlenz.com%2Fdoing-update-with-doctrine-and-a-string-as-parameter%2F&amp;bm_description=Doing%20UPDATE%20with%20Doctrine%20and%20a%20String%20as%20Parameter&amp;plugin=soc" title="MisterWong"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.schuchlenz.com%2Fdoing-update-with-doctrine-and-a-string-as-parameter%2F&amp;t=Doing%20UPDATE%20with%20Doctrine%20and%20a%20String%20as%20Parameter" title="MySpace"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fwww.schuchlenz.com%2Fdoing-update-with-doctrine-and-a-string-as-parameter%2F&amp;title=Doing%20UPDATE%20with%20Doctrine%20and%20a%20String%20as%20Parameter" title="Reddit"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.schuchlenz.com/feed/" title="RSS"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fwww.schuchlenz.com%2Fdoing-update-with-doctrine-and-a-string-as-parameter%2F&amp;t=Doing%20UPDATE%20with%20Doctrine%20and%20a%20String%20as%20Parameter&opener=bm&amp;ei=UTF-8&amp;d=Today%20I%20had%20to%20extend%20a%20few%20Doctrine%20queries%20and%20one%20of%20these%20modifications%20consisted%20of%20changing%20the%20parameter%20of%20an%20UPDATE%20query%20from%20integer%20to%20string%20-%20and%20whoops%21%20It%20didn%27t%20work%20anymore...When%20using%20%24query-%26gt%3BgetSql%28%29%3B%20I%20noticed%20that%20it%20wanted%20" title="Yahoo! Bookmarks"><img src="http://www.schuchlenz.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.schuchlenz.com/symfony-allowing-extra-field-in-validated-forms/" title="Symfony: Allowing extra field in validated forms (04.11.2009)">Symfony: Allowing extra field in validated forms</a> (0)</li>
	<li><a href="http://www.schuchlenz.com/doctrine-queries/" title="Doctrine Queries (04.11.2009)">Doctrine Queries</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.schuchlenz.com/doing-update-with-doctrine-and-a-string-as-parameter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
