<?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>Un naúfrago en una isla &#187; MySQL</title>
	<atom:link href="http://www.irishsquare.com/blog/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.irishsquare.com/blog</link>
	<description>Todo sobre la vida de un madrileño en Dublín</description>
	<lastBuildDate>Wed, 24 Nov 2010 14:25:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Una forma elegante de formatear una fecha</title>
		<link>http://www.irishsquare.com/blog/2010/02/04/una-forma-elegante-de-formatear-una-fecha/</link>
		<comments>http://www.irishsquare.com/blog/2010/02/04/una-forma-elegante-de-formatear-una-fecha/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 14:14:56 +0000</pubDate>
		<dc:creator>Jesús</dc:creator>
				<category><![CDATA[Informática]]></category>
		<category><![CDATA[fechas]]></category>
		<category><![CDATA[formato]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.irishsquare.com/blog/?p=367</guid>
		<description><![CDATA[Todos sabemos que MySQL devuelve los campos de tipo fecha con el formato &#8220;YYYY/MM/DD&#8221; que en Europa es poco práctico, así que a la hora de presentar dichos campos siempre tenemos que formatearlos. En PHP Se puede formatear usando la función substr pero lo cierto es que la forma más elegante sería usando la función [...]]]></description>
			<content:encoded><![CDATA[<p>Todos sabemos que MySQL devuelve los campos de tipo fecha con el formato &#8220;YYYY/MM/DD&#8221; que en Europa es poco práctico, así que a la hora de presentar dichos campos siempre tenemos que formatearlos. En PHP Se puede formatear usando la función <a href="http://php.net/manual/en/function.substr.php">substr</a>  pero lo cierto es que la forma más elegante sería usando la función <a href="http://php.net/manual/en/function.date.php">date</a>:</p>
<pre class="brush: php; title: ; notranslate">
function formatDate($mydate){
		return date('d/m/Y H:i:s',strtotime($mydate));
}
</pre>
<p>Donde $mydate sería el campo fecha devuelto por MySQL.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.irishsquare.com%2Fblog%2F2010%2F02%2F04%2Funa-forma-elegante-de-formatear-una-fecha%2F&amp;title=Una%20forma%20elegante%20de%20formatear%20una%20fecha" id="wpa2a_2"><img src="http://www.irishsquare.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.irishsquare.com/blog/2010/02/04/una-forma-elegante-de-formatear-una-fecha/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>La forma más sencilla de pasar MySQL a Excel con PHP</title>
		<link>http://www.irishsquare.com/blog/2008/09/04/la-forma-mas-sencilla-de-pasar-mysql-a-excel-en-php/</link>
		<comments>http://www.irishsquare.com/blog/2008/09/04/la-forma-mas-sencilla-de-pasar-mysql-a-excel-en-php/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 15:20:55 +0000</pubDate>
		<dc:creator>Jesús</dc:creator>
				<category><![CDATA[Informática]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.irishsquare.com/blog/?p=72</guid>
		<description><![CDATA[No creo que le interese a nadie, pero así siempre lo tengo a mano]]></description>
			<content:encoded><![CDATA[<p>No creo que le interese a nadie, pero así siempre lo tengo a mano <img src='http://www.irishsquare.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: php; title: ; notranslate">
&lt;?
$data=&quot;&quot;;
$result=mysql_query(&quot;SELECT * FROM tabla&quot;);
while($row = mysql_fetch_row($result)){
   $data .='&quot;'.str_replace(&quot;\r&quot;,&quot;&quot;,implode('&quot;,&quot;',$row)).'&quot;'.&quot;\n&quot;;
}

header(&quot;Content-length: &quot;.strlen($data));
header(&quot;Content-Type: application/vnd.ms-excel&quot;);
header(&quot;Content-Disposition: attachment; filename=datos.csv&quot;);
header(&quot;Pragma: no-cache&quot;);
header(&quot;Expires: 0&quot;);
print $data;
?&gt;
</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.irishsquare.com%2Fblog%2F2008%2F09%2F04%2Fla-forma-mas-sencilla-de-pasar-mysql-a-excel-en-php%2F&amp;title=La%20forma%20m%C3%A1s%20sencilla%20de%20pasar%20MySQL%20a%20Excel%20con%20PHP" id="wpa2a_4"><img src="http://www.irishsquare.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.irishsquare.com/blog/2008/09/04/la-forma-mas-sencilla-de-pasar-mysql-a-excel-en-php/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

