<?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>Loogaroo : Lamp / web 2.0 / Ajax ... &#187; PHP</title>
	<atom:link href="http://loogaroo.net/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://loogaroo.net</link>
	<description></description>
	<lastBuildDate>Tue, 14 Jul 2009 17:48:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Zend Framework : Attention aux erreurs</title>
		<link>http://loogaroo.net/2009/03/01/zend-framework-attention-aux-erreurs/</link>
		<comments>http://loogaroo.net/2009/03/01/zend-framework-attention-aux-erreurs/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 21:07:03 +0000</pubDate>
		<dc:creator>Manu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[erreur]]></category>

		<guid isPermaLink="false">http://loogaroo.net/?p=39</guid>
		<description><![CDATA[Me revoilà, je fais pas mal de veille en ce moment pour le développement de la nouvelle version de Wanarun. J&#8217;ai décidé de me baser sur le Zend Framework et j&#8217;ai créé une sur-couche pour placer mes objets. J&#8217;ai donc crée un Load pour Wanarun : class Wanarun_Loader extends Zend_Loader &#123; &#125; que je charge [...]]]></description>
			<content:encoded><![CDATA[<p>Me revoilà, je fais pas mal de veille en ce moment pour le développement de la nouvelle version de <a href="http://www.wanarun.net">Wanarun</a>.</p>
<p>J&#8217;ai décidé de me baser sur le <a href="http://framework.zend.com">Zend Framework</a> et j&#8217;ai créé une sur-couche pour placer mes objets.</p>
<p>J&#8217;ai donc crée un Load pour Wanarun :</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">class</span> Wanarun_Loader <span style="color: #000000; font-weight: bold;">extends</span> Zend_Loader</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li></ol></div></div>
<p>que je charge en début de page :</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/set_include_path"><span style="color: #000066;">set_include_path</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/dirname"><span style="color: #000066;">dirname</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">__FILE__</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #ff0000;">'/../framework/wanarun/library/'</span>.PATH_SEPARATOR.<a href="http://www.php.net/get_include_path"><span style="color: #000066;">get_include_path</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">require_once</span> <span style="color: #ff0000;">&quot;Wanarun/Loader.php&quot;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Wanarun_Loader::<span style="color: #006600;">registerAutoload</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li></ol></div></div>
<p>Je travaillais sur la version 1.7.4 jusqu&#8217;a récemment ou je me suis retrouvé complétement bloqué sur un bug assez bizarre : plus aucune erreur, uniquement une page blanche&#8230;</p>
<p>Il se trouve que dans le Loader Zend sur la version 1.7.4 on avait droit à (ligne 82-83) :</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">...</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">self::_securityCheck<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$file</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">@<span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">$file</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">...</div></li></ol></div></div>
<p>Donc bien sur, aucun probleme d&#8217;erreur dans le Zend Framework (le @ ne pose pas de problème) mais comme j&#8217;héritais du Zend Loader et que j&#8217;avais fait une erreur&#8230; je ne la voyais pas&#8230;</p>
<p>Deux solutions :</p>
<ul>
<li>Upgrader au Zend Framework 1.7.5 qui n&#8217;a pas de @</li>
<li>Supprimer le @</li>
</ul>
<p>Encore une fois du temps perdu à cause de ce satané @&#8230;personnelement je serais pour le retirer dans la version 6&#8230;</p>

<div class="sociable">
<span class="sociable_tagline">
<strong>Partager et découvrir :</strong>
	<span>Ces icônes sont des liens vers des sites de partage de signet sociaux où les lecteurs peuvent partager et découvrir de nouveaux liens.</span>
</span>
<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Floogaroo.net%2F2009%2F03%2F01%2Fzend-framework-attention-aux-erreurs%2F&amp;title=Zend%20Framework%20%3A%20Attention%20aux%20erreurs" title="bodytext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/digg.png" title="bodytext" alt="bodytext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Floogaroo.net%2F2009%2F03%2F01%2Fzend-framework-attention-aux-erreurs%2F&amp;title=Zend%20Framework%20%3A%20Attention%20aux%20erreurs" title="del.icio.us"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Floogaroo.net%2F2009%2F03%2F01%2Fzend-framework-attention-aux-erreurs%2F&amp;title=Zend%20Framework%20%3A%20Attention%20aux%20erreurs&amp;popup=no" title="Netvouz"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Floogaroo.net%2F2009%2F03%2F01%2Fzend-framework-attention-aux-erreurs%2F&amp;title=Zend%20Framework%20%3A%20Attention%20aux%20erreurs" title="description"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.thisnext.com/pick/new/submit/sociable/?url=http%3A%2F%2Floogaroo.net%2F2009%2F03%2F01%2Fzend-framework-attention-aux-erreurs%2F&amp;name=Zend%20Framework%20%3A%20Attention%20aux%20erreurs" title="ThisNext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/thisnext.png" title="ThisNext" alt="ThisNext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Floogaroo.net%2F2009%2F03%2F01%2Fzend-framework-attention-aux-erreurs%2F&amp;bm_description=Zend%20Framework%20%3A%20Attention%20aux%20erreurs&amp;plugin=soc" title="MisterWong"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/misterwong.gif" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://wists.com/s.php?c=&amp;r=http%3A%2F%2Floogaroo.net%2F2009%2F03%2F01%2Fzend-framework-attention-aux-erreurs%2F&amp;title=Zend%20Framework%20%3A%20Attention%20aux%20erreurs" title="Wists"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wists.png" title="Wists" alt="Wists" class="sociable-hovers sociable_wists" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Floogaroo.net%2F2009%2F03%2F01%2Fzend-framework-attention-aux-erreurs%2F&amp;title=Zend%20Framework%20%3A%20Attention%20aux%20erreurs" title="Scoopeo"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/scoopeo.png" title="Scoopeo" alt="Scoopeo" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Floogaroo.net%2F2009%2F03%2F01%2Fzend-framework-attention-aux-erreurs%2F" title="Technorati"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Floogaroo.net%2F2009%2F03%2F01%2Fzend-framework-attention-aux-erreurs%2F" title="Wikio"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://loogaroo.net/2009/03/01/zend-framework-attention-aux-erreurs/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Astuces rewrite&#8230;.</title>
		<link>http://loogaroo.net/2007/10/03/astuces-rewrite/</link>
		<comments>http://loogaroo.net/2007/10/03/astuces-rewrite/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 17:22:51 +0000</pubDate>
		<dc:creator>Manu</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[mod rewrite]]></category>

		<guid isPermaLink="false">http://loogaroo.net/2007/10/03/astuces-rewrite/</guid>
		<description><![CDATA[Avant je ne faisais pas attention au moteur de recherche et a l&#8217;optimisation des pages. Mais c&#8217;est vrai que ca permet quand même de récupérer pas mal d&#8217;utilisateurs parfois. Voila le cas des parcours sur Wanarun. avant j&#8217;avais des urls du genre : http://www.wanarun.net/index.php?content=/view/parcours.php&#038;parcours=2251 et j&#8217;ai décidé d&#8217;activer le mode rewrite pour obtenir ca : [...]]]></description>
			<content:encoded><![CDATA[<p>Avant je ne faisais pas attention au moteur de recherche et a l&#8217;optimisation des pages. Mais c&#8217;est vrai que ca permet quand même de récupérer pas mal d&#8217;utilisateurs parfois. Voila le cas des parcours sur Wanarun.</p>
<p>avant j&#8217;avais des urls du genre :</p>
<p>http://www.wanarun.net/index.php?content=/view/parcours.php&#038;parcours=2251</p>
<p>et j&#8217;ai décidé d&#8217;activer le mode rewrite pour obtenir ca :</p>
<p>http://www.wanarun.net/carte/2251/le-long-du-canal-thaon-les-vosges.html</p>
<p>Je ne vous cache pas que Google adore ce genre d&#8217;URL</p>
<p>Voila le code que j&#8217;ai mis dans mon fichier .htaccess :</p>
<pre>
RewriteEngine On
RewriteRule ^carte/([0-9]+)/(.*).html$ index.php?content=/view/parcours.php&amp;parcours=$1</pre>
<p>Ensuite pour rediriger proprement les anciennes pages j&#8217;ai ajouté ce code dans ma page</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_SERVER</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;SCRIPT_NAME&quot;</span><span style="color: #66cc66;">&#93;</span>==<span style="color: #ff0000;">&quot;/index.php&quot;</span> &amp;<span style="color: #808080; font-style: italic;">#038;&amp;#038; urlParcours($parc_d)!=$_SERVER[&quot;REDIRECT_URL&quot;])</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/header"><span style="color: #000066;">header</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'HTTP/1.1 301 Moved Permanently'</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/header"><span style="color: #000066;">header</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;location: &quot;</span>.urlParcours<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$parc_d</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/exit"><span style="color: #000066;">exit</span></a>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>ma fonction urlParcours renvoit l&#8217;url propre tout simplement.</p>

<div class="sociable">
<span class="sociable_tagline">
<strong>Partager et découvrir :</strong>
	<span>Ces icônes sont des liens vers des sites de partage de signet sociaux où les lecteurs peuvent partager et découvrir de nouveaux liens.</span>
</span>
<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F03%2Fastuces-rewrite%2F&amp;title=Astuces%20rewrite...." title="bodytext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/digg.png" title="bodytext" alt="bodytext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F03%2Fastuces-rewrite%2F&amp;title=Astuces%20rewrite...." title="del.icio.us"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F03%2Fastuces-rewrite%2F&amp;title=Astuces%20rewrite....&amp;popup=no" title="Netvouz"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F03%2Fastuces-rewrite%2F&amp;title=Astuces%20rewrite...." title="description"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.thisnext.com/pick/new/submit/sociable/?url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F03%2Fastuces-rewrite%2F&amp;name=Astuces%20rewrite...." title="ThisNext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/thisnext.png" title="ThisNext" alt="ThisNext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F03%2Fastuces-rewrite%2F&amp;bm_description=Astuces%20rewrite....&amp;plugin=soc" title="MisterWong"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/misterwong.gif" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://wists.com/s.php?c=&amp;r=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F03%2Fastuces-rewrite%2F&amp;title=Astuces%20rewrite...." title="Wists"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wists.png" title="Wists" alt="Wists" class="sociable-hovers sociable_wists" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F03%2Fastuces-rewrite%2F&amp;title=Astuces%20rewrite...." title="Scoopeo"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/scoopeo.png" title="Scoopeo" alt="Scoopeo" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F03%2Fastuces-rewrite%2F" title="Technorati"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F03%2Fastuces-rewrite%2F" title="Wikio"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://loogaroo.net/2007/10/03/astuces-rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql / mysqli / mysqlnd : les extensions PHP pour MySQL</title>
		<link>http://loogaroo.net/2007/10/01/mysql-mysqli-mysqlnd-les-extensions-php-pour-mysql/</link>
		<comments>http://loogaroo.net/2007/10/01/mysql-mysqli-mysqlnd-les-extensions-php-pour-mysql/#comments</comments>
		<pubDate>Mon, 01 Oct 2007 17:46:33 +0000</pubDate>
		<dc:creator>Manu</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://loogaroo.net/2007/10/01/mysql-mysqli-mysqlnd-les-extensions-php-pour-mysql/</guid>
		<description><![CDATA[Le couple PHP / MySQL est devenu inséparable depuis quelques années maintenant&#8230; Mais la vie de couple n&#8217;est pas toujours facile. Il existe 3 façons d&#8217;unir ce couple : ext/mysql : l&#8217;extension mysql classique (old school) que nous avons tous utilisés ext/mysqli : l&#8217;extension mysql &#171;&#160;improved&#160;&#187; (sous entendu amélioré) interface object / prepared statement et [...]]]></description>
			<content:encoded><![CDATA[<p>Le couple PHP / MySQL est devenu inséparable depuis quelques années maintenant&#8230; Mais la vie de couple n&#8217;est pas toujours facile. Il existe 3 façons d&#8217;unir ce couple :</p>
<ul>
<li><a href="http://fr.php.net/mysql">ext/mysql</a> : l&#8217;extension mysql classique (old school) que nous avons tous utilisés</li>
<li><a href="http://fr.php.net/mysqli">ext/mysqli </a>: l&#8217;extension mysql &laquo;&nbsp;improved&nbsp;&raquo; (sous entendu amélioré) interface object  / prepared statement et autres nouveautés</li>
</ul>
<p>Mais voilà, le hic c&#8217;est les fameuses connexions persistentes, depuis toujours on a tous désactiver cette possibilité allant même jusqu&#8217;à oublier qu&#8217;elle existait.</p>
<p>Mais voila MySQL AB a décidé de prendre le taureau par les cornes et de développer une libriairie de remplacement pour résoudre ces problèmes. c&#8217;est chose faite avec mysqlnd (Mysql native driver). cette librairies remplace la librairie libmysql qui se trouve dans PHP et elle est écrit directement par les équipes de MySQL.</p>
<p><a href="http://dev.mysql.com/downloads/connector/php-mysqlnd/">pour en savoir plus </a></p>
<p>A tester !</p>

<div class="sociable">
<span class="sociable_tagline">
<strong>Partager et découvrir :</strong>
	<span>Ces icônes sont des liens vers des sites de partage de signet sociaux où les lecteurs peuvent partager et découvrir de nouveaux liens.</span>
</span>
<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F01%2Fmysql-mysqli-mysqlnd-les-extensions-php-pour-mysql%2F&amp;title=mysql%20%2F%20mysqli%20%2F%20mysqlnd%20%3A%20les%20extensions%20PHP%20pour%20MySQL" title="bodytext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/digg.png" title="bodytext" alt="bodytext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F01%2Fmysql-mysqli-mysqlnd-les-extensions-php-pour-mysql%2F&amp;title=mysql%20%2F%20mysqli%20%2F%20mysqlnd%20%3A%20les%20extensions%20PHP%20pour%20MySQL" title="del.icio.us"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F01%2Fmysql-mysqli-mysqlnd-les-extensions-php-pour-mysql%2F&amp;title=mysql%20%2F%20mysqli%20%2F%20mysqlnd%20%3A%20les%20extensions%20PHP%20pour%20MySQL&amp;popup=no" title="Netvouz"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F01%2Fmysql-mysqli-mysqlnd-les-extensions-php-pour-mysql%2F&amp;title=mysql%20%2F%20mysqli%20%2F%20mysqlnd%20%3A%20les%20extensions%20PHP%20pour%20MySQL" title="description"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.thisnext.com/pick/new/submit/sociable/?url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F01%2Fmysql-mysqli-mysqlnd-les-extensions-php-pour-mysql%2F&amp;name=mysql%20%2F%20mysqli%20%2F%20mysqlnd%20%3A%20les%20extensions%20PHP%20pour%20MySQL" title="ThisNext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/thisnext.png" title="ThisNext" alt="ThisNext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F01%2Fmysql-mysqli-mysqlnd-les-extensions-php-pour-mysql%2F&amp;bm_description=mysql%20%2F%20mysqli%20%2F%20mysqlnd%20%3A%20les%20extensions%20PHP%20pour%20MySQL&amp;plugin=soc" title="MisterWong"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/misterwong.gif" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://wists.com/s.php?c=&amp;r=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F01%2Fmysql-mysqli-mysqlnd-les-extensions-php-pour-mysql%2F&amp;title=mysql%20%2F%20mysqli%20%2F%20mysqlnd%20%3A%20les%20extensions%20PHP%20pour%20MySQL" title="Wists"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wists.png" title="Wists" alt="Wists" class="sociable-hovers sociable_wists" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F01%2Fmysql-mysqli-mysqlnd-les-extensions-php-pour-mysql%2F&amp;title=mysql%20%2F%20mysqli%20%2F%20mysqlnd%20%3A%20les%20extensions%20PHP%20pour%20MySQL" title="Scoopeo"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/scoopeo.png" title="Scoopeo" alt="Scoopeo" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F01%2Fmysql-mysqli-mysqlnd-les-extensions-php-pour-mysql%2F" title="Technorati"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Floogaroo.net%2F2007%2F10%2F01%2Fmysql-mysqli-mysqlnd-les-extensions-php-pour-mysql%2F" title="Wikio"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://loogaroo.net/2007/10/01/mysql-mysqli-mysqlnd-les-extensions-php-pour-mysql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Modification javascript pour les tables</title>
		<link>http://loogaroo.net/2007/09/28/modification-javascript-pour-les-tables/</link>
		<comments>http://loogaroo.net/2007/09/28/modification-javascript-pour-les-tables/#comments</comments>
		<pubDate>Fri, 28 Sep 2007 17:32:25 +0000</pubDate>
		<dc:creator>Manu</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[optimisation]]></category>

		<guid isPermaLink="false">http://loogaroo.net/2007/09/28/modification-javascript-pour-les-tables/</guid>
		<description><![CDATA[Comme plusieurs d&#8217;entre vous veulent connaitre les modifications que j&#8217;ai fait pour les tableaux javascript (suite des commentaires sur l&#8217;article &#171;&#160;Economisez votre serveur : Triez en javascript&#160;&#187; Pour rappel, la page d&#8217;exemple se trouve ici : la page des entrainements de MARC78 sur Wanarun Les modifications de la librairies sortable.js Ajout d&#8217;une variable pour la [...]]]></description>
			<content:encoded><![CDATA[<p>Comme plusieurs d&#8217;entre vous veulent connaitre les modifications que j&#8217;ai fait pour les tableaux javascript (suite des commentaires sur l&#8217;article <a href="/2007/09/07/economisez-votre-serveur-triez-en-javascript/">&laquo;&nbsp;Economisez votre serveur : Triez en javascript&nbsp;&raquo;</a><a href="/2007/09/07/economisez-votre-serveur-triez-en-javascript/"></a></p>
<p>Pour rappel, la page d&#8217;exemple se trouve ici : <a href="http://www.wanarun.net/espace/MARC78/entrainements/">la page des entrainements de MARC78  sur Wanarun</a></p>
<p>Les modifications de la librairies sortable.js<br />
Ajout d&#8217;une variable pour la taille des pages</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="javascript" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> maxRows=<span style="color: #CC0000;">20</span>;</div></li></ol></div></div>
<p>Ajout de la fonction showPageTable()</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="javascript" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> showPageTable<span style="color: #66cc66;">&#40;</span>table,number<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span>j=<span style="color: #CC0000;">1</span>;j</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;table.<span style="color: #006600;">rows</span>.<span style="color: #006600;">length</span>;j++<span style="color: #66cc66;">&#41;</span>&gt;<span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>j&lt;maxrows*<span style="color: #66cc66;">&#40;</span>number<span style="color: #CC0000;">-1</span><span style="color: #66cc66;">&#41;</span>&gt;=<span style="color: #66cc66;">&#40;</span>maxRows*<span style="color: #66cc66;">&#40;</span>number<span style="color: #66cc66;">&#41;</span><span style="color: #CC0000;">+1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; table.<span style="color: #006600;">rows</span><span style="color: #66cc66;">&#91;</span>j<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span>=<span style="color: #3366CC;">'none'</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; table.<span style="color: #006600;">rows</span><span style="color: #66cc66;">&#91;</span>j<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span>=<span style="color: #3366CC;">''</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Modification de sortables_init()</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="javascript" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">//après la ligne</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ts_makeSortable<span style="color: #66cc66;">&#40;</span>thisTbl<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">//j'initiliase mon tableau sur la premiere page</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">showPageTable<span style="color: #66cc66;">&#40;</span>thisTbl,<span style="color: #3366CC;">'1'</span><span style="color: #66cc66;">&#41;</span>;</div></li></ol></div></div>
<p>Dans le php</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//il faut définir une variable commune avec le javascript</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/define"><span style="color: #000066;">define</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;NB_LIGNE_TABLEAU&quot;</span>,<span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$list</span>=<span style="color: #0000ff;">$data</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;performance&quot;</span><span style="color: #66cc66;">&#93;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$page_str</span>=<span style="color: #ff0000;">&quot;&quot;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$separator</span>=<span style="color: #ff0000;">&quot; | &quot;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$nb_page</span>=<a href="http://www.php.net/floor"><span style="color: #000066;">floor</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/sizeof"><span style="color: #000066;">sizeof</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$list</span><span style="color: #66cc66;">&#41;</span>/NB_LIGNE_TABLEAU<span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;">+1</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$nb_page</span>&amp;gt;<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$i</span>=<span style="color: #cc66cc;">1</span>;<span style="color: #0000ff;">$i</span>&amp;lt;=<span style="color: #0000ff;">$nb_page</span>;<span style="color: #0000ff;">$i</span>++<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$page_str</span>.=<span style="color: #ff0000;">&quot;&lt;a href=&quot;</span><span style="color: #808080; font-style: italic;">#&quot; onclick=&quot;\&quot;showPageTable($('unique_id'),'&quot;.$i.&quot;')\&quot;&quot;&gt;&quot;.$i.&quot;&lt;/a&gt;&quot;;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$page_str</span>.=<span style="color: #0000ff;">$separator</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <a href="http://www.php.net/substr"><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$page_str</span>,<span style="color: #cc66cc;">0</span>,-<a href="http://www.php.net/strlen"><span style="color: #000066;">strlen</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$separator</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>

<div class="sociable">
<span class="sociable_tagline">
<strong>Partager et découvrir :</strong>
	<span>Ces icônes sont des liens vers des sites de partage de signet sociaux où les lecteurs peuvent partager et découvrir de nouveaux liens.</span>
</span>
<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F28%2Fmodification-javascript-pour-les-tables%2F&amp;title=Modification%20javascript%20pour%20les%20tables%20" title="bodytext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/digg.png" title="bodytext" alt="bodytext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F28%2Fmodification-javascript-pour-les-tables%2F&amp;title=Modification%20javascript%20pour%20les%20tables%20" title="del.icio.us"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F28%2Fmodification-javascript-pour-les-tables%2F&amp;title=Modification%20javascript%20pour%20les%20tables%20&amp;popup=no" title="Netvouz"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F28%2Fmodification-javascript-pour-les-tables%2F&amp;title=Modification%20javascript%20pour%20les%20tables%20" title="description"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.thisnext.com/pick/new/submit/sociable/?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F28%2Fmodification-javascript-pour-les-tables%2F&amp;name=Modification%20javascript%20pour%20les%20tables%20" title="ThisNext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/thisnext.png" title="ThisNext" alt="ThisNext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F28%2Fmodification-javascript-pour-les-tables%2F&amp;bm_description=Modification%20javascript%20pour%20les%20tables%20&amp;plugin=soc" title="MisterWong"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/misterwong.gif" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://wists.com/s.php?c=&amp;r=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F28%2Fmodification-javascript-pour-les-tables%2F&amp;title=Modification%20javascript%20pour%20les%20tables%20" title="Wists"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wists.png" title="Wists" alt="Wists" class="sociable-hovers sociable_wists" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F28%2Fmodification-javascript-pour-les-tables%2F&amp;title=Modification%20javascript%20pour%20les%20tables%20" title="Scoopeo"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/scoopeo.png" title="Scoopeo" alt="Scoopeo" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F28%2Fmodification-javascript-pour-les-tables%2F" title="Technorati"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F28%2Fmodification-javascript-pour-les-tables%2F" title="Wikio"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://loogaroo.net/2007/09/28/modification-javascript-pour-les-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Astuces pour les scripts Shell</title>
		<link>http://loogaroo.net/2007/09/19/astuces-pour-les-scripts-shell/</link>
		<comments>http://loogaroo.net/2007/09/19/astuces-pour-les-scripts-shell/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 17:19:53 +0000</pubDate>
		<dc:creator>Manu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[ligne de commande]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[trucs et astuces]]></category>

		<guid isPermaLink="false">http://loogaroo.net/2007/09/19/astuces-pour-les-scripts-shell/</guid>
		<description><![CDATA[Vous êtes peut être comme moi, vous utilisez PHP pour faire des scripts shell. J&#8217;utilise une petite astuce pour mettre en place des variables dans mes scripts en reprennant la syntaxe qu&#8217;on utilise sous linux avec &#171;&#160;&#8211;var value&#160;&#187; un petit include que vous pouvez transformez en fonction comme bon vous semble. for&#40;$i=1;$i&#60;sizeof&#40;$argv&#41;;$i++&#41; &#123; &#160;if &#40;substr&#40;$argv&#91;$i&#93;,0,2&#41;==&#34;--&#34;&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>Vous êtes peut être comme moi, vous utilisez PHP pour faire des scripts shell. J&#8217;utilise une petite astuce pour mettre en place des variables dans mes scripts en reprennant la syntaxe qu&#8217;on utilise sous linux avec &laquo;&nbsp;<strong><em>&#8211;var value</em></strong>&nbsp;&raquo;</p>
<p>un petit include que vous pouvez transformez en fonction comme bon vous semble.</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$i</span>=<span style="color: #cc66cc;">1</span>;<span style="color: #0000ff;">$i</span>&lt;sizeof<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #0000ff;">$i</span>++<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/substr"><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #66cc66;">&#93;</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>==<span style="color: #ff0000;">&quot;--&quot;</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">$_REQUEST</span><span style="color: #66cc66;">&#91;</span><a href="http://www.php.net/substr"><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #66cc66;">&#93;</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>=<span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$i</span><span style="color: #cc66cc;">+1</span><span style="color: #66cc66;">&#93;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color: #0000ff;">$i</span>++;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/extract"><span style="color: #000066;">extract</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_REQUEST</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Comme ca quand je lance "<strong><em>mon_script.php --code TE --mode debug</em></strong>"</p>
<p>c'est comme si je faisais :</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$code</span>=<span style="color: #ff0000;">&quot;TE&quot;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$mode</span>=<span style="color: #ff0000;">&quot;debug&quot;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Ca n'interessera peut être pas tout le monde mais c'est bien pratique !</p>

<div class="sociable">
<span class="sociable_tagline">
<strong>Partager et découvrir :</strong>
	<span>Ces icônes sont des liens vers des sites de partage de signet sociaux où les lecteurs peuvent partager et découvrir de nouveaux liens.</span>
</span>
<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell" title="bodytext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/digg.png" title="bodytext" alt="bodytext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell" title="del.icio.us"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell&amp;popup=no" title="Netvouz"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell" title="description"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.thisnext.com/pick/new/submit/sociable/?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;name=Astuces%20pour%20les%20scripts%20Shell" title="ThisNext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/thisnext.png" title="ThisNext" alt="ThisNext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;bm_description=Astuces%20pour%20les%20scripts%20Shell&amp;plugin=soc" title="MisterWong"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/misterwong.gif" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://wists.com/s.php?c=&amp;r=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell" title="Wists"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wists.png" title="Wists" alt="Wists" class="sociable-hovers sociable_wists" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F&amp;title=Astuces%20pour%20les%20scripts%20Shell" title="Scoopeo"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/scoopeo.png" title="Scoopeo" alt="Scoopeo" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F" title="Technorati"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F19%2Fastuces-pour-les-scripts-shell%2F" title="Wikio"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://loogaroo.net/2007/09/19/astuces-pour-les-scripts-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Créer une table temporaire</title>
		<link>http://loogaroo.net/2007/09/18/creer-une-table-temporaire/</link>
		<comments>http://loogaroo.net/2007/09/18/creer-une-table-temporaire/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 17:51:55 +0000</pubDate>
		<dc:creator>Manu</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[optimisation]]></category>

		<guid isPermaLink="false">http://loogaroo.net/2007/09/18/creer-une-table-temporaire/</guid>
		<description><![CDATA[Parfois, il est préférable ou nécessaire de passer par une table temporaire pour insérer / mettre a jour des données. Ca vous permet d&#8217;insérer les données et eventuellement de vérifier la table temporaire avant de permutter les 2 tables. Par exemple, vérifier que votre table comporte au moins 10 éléments ou n&#8217;est pas vide. &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Parfois, il est préférable ou nécessaire de passer par une table temporaire pour insérer / mettre a jour des données.<br />
Ca vous permet d&#8217;insérer les données et eventuellement de vérifier la table temporaire avant de permutter les 2 tables.<br />
Par exemple, vérifier que votre table comporte au moins 10 éléments ou n&#8217;est pas vide.</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//j'efface la table temporaire si elle existe :</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$res</span>=<a href="http://www.php.net/mysql_query"><span style="color: #000066;">mysql_query</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;drop table if exists my_table_tmp&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$res</span>==<span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span> <a href="http://www.php.net/die"><span style="color: #000066;">die</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Erreur mysql &quot;</span>.<a href="http://www.php.net/mysql_error"><span style="color: #000066;">mysql_error</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//je récupére la structure de la table maitre</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$res</span>=<a href="http://www.php.net/mysql_query"><span style="color: #000066;">mysql_query</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;show create table my_table&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$res</span>==<span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span> <a href="http://www.php.net/die"><span style="color: #000066;">die</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Erreur mysql &quot;</span>.<a href="http://www.php.net/mysql_error"><span style="color: #000066;">mysql_error</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$row</span>=<a href="http://www.php.net/mysql_fetch_row"><span style="color: #000066;">mysql_fetch_row</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$res</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$create</span>=<span style="color: #0000ff;">$row</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//je substitue le nom de ma table maitre pour créer ma table temporaire</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$create</span>=<a href="http://www.php.net/str_replace"><span style="color: #000066;">str_replace</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;my_table&quot;</span>,<span style="color: #ff0000;">&quot;my_table_tmp&quot;</span>,<span style="color: #0000ff;">$create</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//je crée ma table temporaire.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$res</span>=<a href="http://www.php.net/mysql_query"><span style="color: #000066;">mysql_query</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$create</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!<span style="color: #0000ff;">$res</span><span style="color: #66cc66;">&#41;</span> <a href="http://www.php.net/die"><span style="color: #000066;">die</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Erreur mysql &quot;</span>.<a href="http://www.php.net/mysql_error"><span style="color: #000066;">mysql_error</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>La requete utilisant <a href="http://dev.mysql.com/doc/refman/5.0/fr/rename-table.html">RENAME TABLE</a> est pratique pour ce cas :</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="sql" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">RENAME</span> <span style="color: #993333; font-weight: bold;">TABLE</span> my_table <span style="color: #993333; font-weight: bold;">TO</span> my_table_backup, my_table_tmp <span style="color: #993333; font-weight: bold;">TO</span> my_table;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>en PHP ca donne :</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//Je permutte les tables</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$res</span>=<a href="http://www.php.net/mysql_query"><span style="color: #000066;">mysql_query</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;RENAME TABLE my_table TO my_table_backup, my_table_tmp TO my_table&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!<span style="color: #0000ff;">$res</span><span style="color: #66cc66;">&#41;</span> <a href="http://www.php.net/die"><span style="color: #000066;">die</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Erreur mysql &quot;</span>.<a href="http://www.php.net/mysql_error"><span style="color: #000066;">mysql_error</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>

<div class="sociable">
<span class="sociable_tagline">
<strong>Partager et découvrir :</strong>
	<span>Ces icônes sont des liens vers des sites de partage de signet sociaux où les lecteurs peuvent partager et découvrir de nouveaux liens.</span>
</span>
<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F18%2Fcreer-une-table-temporaire%2F&amp;title=Cr%C3%A9er%20une%20table%20temporaire" title="bodytext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/digg.png" title="bodytext" alt="bodytext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F18%2Fcreer-une-table-temporaire%2F&amp;title=Cr%C3%A9er%20une%20table%20temporaire" title="del.icio.us"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F18%2Fcreer-une-table-temporaire%2F&amp;title=Cr%C3%A9er%20une%20table%20temporaire&amp;popup=no" title="Netvouz"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F18%2Fcreer-une-table-temporaire%2F&amp;title=Cr%C3%A9er%20une%20table%20temporaire" title="description"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.thisnext.com/pick/new/submit/sociable/?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F18%2Fcreer-une-table-temporaire%2F&amp;name=Cr%C3%A9er%20une%20table%20temporaire" title="ThisNext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/thisnext.png" title="ThisNext" alt="ThisNext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F18%2Fcreer-une-table-temporaire%2F&amp;bm_description=Cr%C3%A9er%20une%20table%20temporaire&amp;plugin=soc" title="MisterWong"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/misterwong.gif" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://wists.com/s.php?c=&amp;r=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F18%2Fcreer-une-table-temporaire%2F&amp;title=Cr%C3%A9er%20une%20table%20temporaire" title="Wists"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wists.png" title="Wists" alt="Wists" class="sociable-hovers sociable_wists" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F18%2Fcreer-une-table-temporaire%2F&amp;title=Cr%C3%A9er%20une%20table%20temporaire" title="Scoopeo"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/scoopeo.png" title="Scoopeo" alt="Scoopeo" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F18%2Fcreer-une-table-temporaire%2F" title="Technorati"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F18%2Fcreer-une-table-temporaire%2F" title="Wikio"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://loogaroo.net/2007/09/18/creer-une-table-temporaire/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Filtrons les entrées</title>
		<link>http://loogaroo.net/2007/09/15/filtrons-les-entrees/</link>
		<comments>http://loogaroo.net/2007/09/15/filtrons-les-entrees/#comments</comments>
		<pubDate>Sat, 15 Sep 2007 15:29:50 +0000</pubDate>
		<dc:creator>Manu</dc:creator>
				<category><![CDATA[Lamp]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[evangélisation]]></category>
		<category><![CDATA[trucs et astuces]]></category>

		<guid isPermaLink="false">http://loogaroo.net/2007/09/15/filtrons-les-entrees/</guid>
		<description><![CDATA[Afin de sécuriser au maximum vos sites, la première règle est de bien faire attention aux entrées utilisateurs. Cette partie peut être un peu fastidieuse mais c&#8217;est une des règles à respecter. Les 3 règles les plus importantes : Initialiser vos variables utilisées dans la page. Vérifiez les variables rentrées par l&#8217;utilisateur. Vérifiez l&#8217;entrée des [...]]]></description>
			<content:encoded><![CDATA[<p>Afin de sécuriser au maximum vos sites, la première règle est de bien faire attention aux entrées utilisateurs. Cette partie peut être un peu fastidieuse mais c&#8217;est une des règles à respecter.</p>
<p>Les 3 règles les plus importantes :</p>
<ol>
<li>Initialiser vos variables utilisées dans la page.</li>
<li>Vérifiez les variables rentrées par l&#8217;utilisateur.</li>
<li>Vérifiez l&#8217;entrée des fonctions include / require fichiers.</li>
</ol>
<p>La question c&#8217;est donc comment verifier vos variables simplement et efficacement.</p>
<p>Avant PHP 5.2, chacun avait sa propre recette de cuisine car il n&#8217;y avait aucune veritable solution dans PHP alors que tout le monde disait que c&#8217;était très important surtout suite aux nombreuses alertes qu&#8217;on voyait fleurir sur des logiciels Open Source.</p>
<p>Depuis PHP 5.2, l&#8217;extension <a href="http://fr.php.net/filter">filter</a> (disponible jusqu&#8217;alors via PECL) a été inclus dans la distribution standard.</p>
<p>Cette extension est très pratique, elle permet par exemple de valider une adresse email sans se prendre la tête avec les dizaines d&#8217;expressions regulières que vous verez ici ou là sur Internet.</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$email</span>=<span style="color: #ff0000;">'nimportequoiyahoo.fr'</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0000ff;">$email</span>=filter_var<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$email</span>, FILTER_VALIDATE_EMAIL<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//$email est à null car l'adresse est incorrecte</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$email</span>=<span style="color: #ff0000;">'bonneadresse@bondomaine.com'</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$email</span>=filter_var<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$email</span>, FILTER_VALIDATE_EMAIL<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//$email vaut &quot;bonneadresse@bondomaine.com&quot;</span></div></li></ol></div></div>
<p>A retenir, on met la variable en premier argument et le filtre qu&#8217;on veut appliquer en deuxième.<br />
Si cela retourne <em>&laquo;&nbsp;null&nbsp;&raquo;</em>, la variable n&#8217;est pas correcte sinon elle est correcte.</p>
<p>Aprés on peut faire des choses plus complexe, l&#8217;utilisateur doit rentrer un entier entre 1 et 10</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$categorie</span>=filter_var<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'categorie'</span><span style="color: #66cc66;">&#93;</span>,</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//je veux uniquement un entier</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'filter'</span>&nbsp; &nbsp; =&amp;gt; FILTER_VALIDATE_INT,</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//il doit etre compris dans un tableau</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'flags'</span>&nbsp; &nbsp; &nbsp;=&amp;gt; FILTER_REQUIRE_ARRAY,</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//entre 1 et 10</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'options'</span>&nbsp; &nbsp;=&amp;gt; <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #ff0000;">'min_range'</span> =&amp;gt; <span style="color: #cc66cc;">1</span>,</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span style="color: #ff0000;">'max_range'</span> =&amp;gt; <span style="color: #cc66cc;">10</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li></ol></div></div>
<p>Aprés dans la vie de tous les jours, vous aimeriez filtrer l&#8217;ensemble de votre formulaire en une seule fois :</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// je decris mon formulaire sous forme de tableau</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// avec les format attendu</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$config_form</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff0000;">'produit'</span>&nbsp; &nbsp;=&amp;gt; FILTER_VALIDATE_INT,</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #ff0000;">'categorie'</span>&nbsp; &nbsp; =&amp;gt; <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'filter'</span>&nbsp; &nbsp; =&amp;gt; FILTER_VALIDATE_INT,</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'flags'</span>&nbsp; &nbsp; &nbsp;=&amp;gt;FILTER_REQUIRE_ARRAY,</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">'options'</span>&nbsp; &nbsp;=&amp;gt; <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'min_range'</span> =&amp;gt; <span style="color: #cc66cc;">1</span>, <span style="color: #ff0000;">'max_range'</span> =&amp;gt; <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$_POST_CLEAN</span> = filter_input_array<span style="color: #66cc66;">&#40;</span>INPUT_POST, <span style="color: #0000ff;">$config_form</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//je recupére ainsi dans $_POST_CLEAN tout ce qui était</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//dans $_POST mais maintenant les données sont</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//filtrées.</span></div></li></ol></div></div>
<p>A vous de jouer !</p>

<div class="sociable">
<span class="sociable_tagline">
<strong>Partager et découvrir :</strong>
	<span>Ces icônes sont des liens vers des sites de partage de signet sociaux où les lecteurs peuvent partager et découvrir de nouveaux liens.</span>
</span>
<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F15%2Ffiltrons-les-entrees%2F&amp;title=Filtrons%20les%20entr%C3%A9es" title="bodytext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/digg.png" title="bodytext" alt="bodytext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F15%2Ffiltrons-les-entrees%2F&amp;title=Filtrons%20les%20entr%C3%A9es" title="del.icio.us"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F15%2Ffiltrons-les-entrees%2F&amp;title=Filtrons%20les%20entr%C3%A9es&amp;popup=no" title="Netvouz"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F15%2Ffiltrons-les-entrees%2F&amp;title=Filtrons%20les%20entr%C3%A9es" title="description"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.thisnext.com/pick/new/submit/sociable/?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F15%2Ffiltrons-les-entrees%2F&amp;name=Filtrons%20les%20entr%C3%A9es" title="ThisNext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/thisnext.png" title="ThisNext" alt="ThisNext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F15%2Ffiltrons-les-entrees%2F&amp;bm_description=Filtrons%20les%20entr%C3%A9es&amp;plugin=soc" title="MisterWong"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/misterwong.gif" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://wists.com/s.php?c=&amp;r=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F15%2Ffiltrons-les-entrees%2F&amp;title=Filtrons%20les%20entr%C3%A9es" title="Wists"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wists.png" title="Wists" alt="Wists" class="sociable-hovers sociable_wists" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F15%2Ffiltrons-les-entrees%2F&amp;title=Filtrons%20les%20entr%C3%A9es" title="Scoopeo"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/scoopeo.png" title="Scoopeo" alt="Scoopeo" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F15%2Ffiltrons-les-entrees%2F" title="Technorati"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F15%2Ffiltrons-les-entrees%2F" title="Wikio"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://loogaroo.net/2007/09/15/filtrons-les-entrees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Et si MySQL était mort ?</title>
		<link>http://loogaroo.net/2007/09/13/et-si-mysql-etait-mort/</link>
		<comments>http://loogaroo.net/2007/09/13/et-si-mysql-etait-mort/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 19:35:25 +0000</pubDate>
		<dc:creator>Manu</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Mysql Error Stop]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[trucs et astuces]]></category>

		<guid isPermaLink="false">http://loogaroo.net/2007/09/13/et-si-mysql-etait-mort/</guid>
		<description><![CDATA[Une chose assez importante auquel les développeurs ne pensent pas tout le temps : Avez vous verifié si votre serveur MySQL fonctionne correctement ? Est-ce que la fonction mysql_connect / mysqli_connect ne renvoit pas false ? Je pense que beaucoup oublie cet étape, c&#8217;est comprehensible dans l&#8217;euphorie du développement. J&#8217;ai fait une petite requète sur [...]]]></description>
			<content:encoded><![CDATA[<p>Une chose assez importante auquel les développeurs ne pensent pas tout le temps : Avez vous verifié si votre serveur MySQL fonctionne correctement ? Est-ce que la fonction mysql_connect / mysqli_connect ne renvoit pas false ?</p>
<p>Je pense que beaucoup oublie cet étape, c&#8217;est comprehensible dans l&#8217;euphorie du développement. J&#8217;ai fait une petite requète sur <a href="http://www.google.fr/search?num=100&amp;hl=fr&amp;client=firefox-a&amp;rls=com.ubuntu%3Aen-US%3Aofficial&amp;hs=mQ1&amp;q=%22supplied+argument+is+not+a+valid+MySQL-Link%22&amp;btnG=Rechercher&amp;meta=">Google</a>  et je vois tout simplement 734000 pages avec une erreur qui découle de ce problème&#8230;</p>
<p>C&#8217;est pas bien compliqué, il faut juste y penser !</p>
<div style="overflow: auto; width: 450px;padding-bottom: 15px;"><div class="php" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0000ff;">$my</span>=<a href="http://www.php.net/mysql_connect"><span style="color: #000066;">mysql_connect</span></a><span style="color: #66cc66;">&#40;</span>...,...,...<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$my</span>===<span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/header"><span style="color: #000066;">header</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;location: /mysql_out.php&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #808080; font-style: italic;">// a la rigueur on envoie un petit mail au webmaster pour le mettre au courant</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/mail"><span style="color: #000066;">mail</span></a><span style="color: #66cc66;">&#40;</span>...,...,...,...<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/exit"><span style="color: #000066;">exit</span></a>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li></ol></div></div>
<p>Allez je referai un petit point de temps en temps pour voir si ce nombre (734 000 pages sur Google) baisse un peu !</p>

<div class="sociable">
<span class="sociable_tagline">
<strong>Partager et découvrir :</strong>
	<span>Ces icônes sont des liens vers des sites de partage de signet sociaux où les lecteurs peuvent partager et découvrir de nouveaux liens.</span>
</span>
<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F13%2Fet-si-mysql-etait-mort%2F&amp;title=Et%20si%20MySQL%20%C3%A9tait%20mort%20%3F" title="bodytext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/digg.png" title="bodytext" alt="bodytext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F13%2Fet-si-mysql-etait-mort%2F&amp;title=Et%20si%20MySQL%20%C3%A9tait%20mort%20%3F" title="del.icio.us"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F13%2Fet-si-mysql-etait-mort%2F&amp;title=Et%20si%20MySQL%20%C3%A9tait%20mort%20%3F&amp;popup=no" title="Netvouz"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F13%2Fet-si-mysql-etait-mort%2F&amp;title=Et%20si%20MySQL%20%C3%A9tait%20mort%20%3F" title="description"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.thisnext.com/pick/new/submit/sociable/?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F13%2Fet-si-mysql-etait-mort%2F&amp;name=Et%20si%20MySQL%20%C3%A9tait%20mort%20%3F" title="ThisNext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/thisnext.png" title="ThisNext" alt="ThisNext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F13%2Fet-si-mysql-etait-mort%2F&amp;bm_description=Et%20si%20MySQL%20%C3%A9tait%20mort%20%3F&amp;plugin=soc" title="MisterWong"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/misterwong.gif" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://wists.com/s.php?c=&amp;r=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F13%2Fet-si-mysql-etait-mort%2F&amp;title=Et%20si%20MySQL%20%C3%A9tait%20mort%20%3F" title="Wists"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wists.png" title="Wists" alt="Wists" class="sociable-hovers sociable_wists" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F13%2Fet-si-mysql-etait-mort%2F&amp;title=Et%20si%20MySQL%20%C3%A9tait%20mort%20%3F" title="Scoopeo"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/scoopeo.png" title="Scoopeo" alt="Scoopeo" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F13%2Fet-si-mysql-etait-mort%2F" title="Technorati"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F13%2Fet-si-mysql-etait-mort%2F" title="Wikio"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://loogaroo.net/2007/09/13/et-si-mysql-etait-mort/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Opération booléenne en PHP</title>
		<link>http://loogaroo.net/2007/09/06/operation-booleenne-en-php/</link>
		<comments>http://loogaroo.net/2007/09/06/operation-booleenne-en-php/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 15:55:28 +0000</pubDate>
		<dc:creator>Manu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[bool]]></category>
		<category><![CDATA[logique]]></category>

		<guid isPermaLink="false">http://loogaroo.net/2007/09/06/operation-booleenne-en-php/</guid>
		<description><![CDATA[PHP est un language non typé, et c&#8217;est parfois le casse-tête en particulier pour les tests booléens, j&#8217;avoue que je prefère parfois utilisé le === en particulier sur la fonction strpos. Qui ne c&#8217;est pas fait avoir sur un &#171;&#160;if (strpos)&#160;&#187; ! Pour vous tester sur la logique booléenne voilà un test pour remettre à [...]]]></description>
			<content:encoded><![CDATA[<p>PHP est un language non typé, et c&#8217;est parfois le casse-tête en particulier pour les tests booléens, j&#8217;avoue que je prefère parfois utilisé le === en particulier sur la fonction <a href="http://fr.php.net/strpos">strpos</a>. Qui ne c&#8217;est pas fait avoir sur un <strong>&laquo;&nbsp;if (strpos)&nbsp;&raquo; </strong>!</p>
<p>Pour vous tester sur la logique booléenne voilà un <a href="http://www.blueshoes.org/en/developer/syntax_exam/">test</a> pour remettre à jour vos neurones.</p>
<p>Vous avez un trou de mémoire concernant toutes ses opérations élementaires (<a href="http://fr.php.net/isset">isset</a>, <a href="http://fr.php.net/is_null">is_null</a>, ==false,&#8230;), voici les <a href="http://www.blueshoes.org/en/developer/php_cheat_sheet/">tableaux de corrrespondance </a>de tous les tests.</p>
<p>Bon courage</p>

<div class="sociable">
<span class="sociable_tagline">
<strong>Partager et découvrir :</strong>
	<span>Ces icônes sont des liens vers des sites de partage de signet sociaux où les lecteurs peuvent partager et découvrir de nouveaux liens.</span>
</span>
<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F06%2Foperation-booleenne-en-php%2F&amp;title=Op%C3%A9ration%20bool%C3%A9enne%20en%20PHP" title="bodytext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/digg.png" title="bodytext" alt="bodytext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F06%2Foperation-booleenne-en-php%2F&amp;title=Op%C3%A9ration%20bool%C3%A9enne%20en%20PHP" title="del.icio.us"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F06%2Foperation-booleenne-en-php%2F&amp;title=Op%C3%A9ration%20bool%C3%A9enne%20en%20PHP&amp;popup=no" title="Netvouz"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F06%2Foperation-booleenne-en-php%2F&amp;title=Op%C3%A9ration%20bool%C3%A9enne%20en%20PHP" title="description"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.thisnext.com/pick/new/submit/sociable/?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F06%2Foperation-booleenne-en-php%2F&amp;name=Op%C3%A9ration%20bool%C3%A9enne%20en%20PHP" title="ThisNext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/thisnext.png" title="ThisNext" alt="ThisNext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F06%2Foperation-booleenne-en-php%2F&amp;bm_description=Op%C3%A9ration%20bool%C3%A9enne%20en%20PHP&amp;plugin=soc" title="MisterWong"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/misterwong.gif" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://wists.com/s.php?c=&amp;r=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F06%2Foperation-booleenne-en-php%2F&amp;title=Op%C3%A9ration%20bool%C3%A9enne%20en%20PHP" title="Wists"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wists.png" title="Wists" alt="Wists" class="sociable-hovers sociable_wists" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F06%2Foperation-booleenne-en-php%2F&amp;title=Op%C3%A9ration%20bool%C3%A9enne%20en%20PHP" title="Scoopeo"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/scoopeo.png" title="Scoopeo" alt="Scoopeo" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F06%2Foperation-booleenne-en-php%2F" title="Technorati"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F06%2Foperation-booleenne-en-php%2F" title="Wikio"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://loogaroo.net/2007/09/06/operation-booleenne-en-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objet PHP : attention au __destruct</title>
		<link>http://loogaroo.net/2007/09/04/objet-php-attention-au-__destruct/</link>
		<comments>http://loogaroo.net/2007/09/04/objet-php-attention-au-__destruct/#comments</comments>
		<pubDate>Tue, 04 Sep 2007 17:23:43 +0000</pubDate>
		<dc:creator>Manu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[objet]]></category>
		<category><![CDATA[programmation]]></category>
		<category><![CDATA[trucs et astuces]]></category>

		<guid isPermaLink="false">http://loogaroo.net/2007/09/04/objet-php-attention-au-__destruct/</guid>
		<description><![CDATA[Dans la bible des erreurs à éviter car elles peuvent prendre la tête : la fonction __destruct sur un objet PHP. Il faut être trés vigilent, en effet, cette fonction est appellé même après un exit, donc on peut avoir un état en base de donnée juste avant exit qu&#8217;on vient de verifier par un [...]]]></description>
			<content:encoded><![CDATA[<p>Dans la bible des erreurs à éviter car elles peuvent prendre la tête : la fonction <strong>__destruct</strong> sur un objet PHP.</p>
<p>Il faut être trés vigilent, en effet, cette fonction est appellé même après un <strong>exit</strong>, donc on peut avoir un état en base de donnée juste avant <strong>exit </strong>qu&#8217;on vient de verifier par un dump.</p>
<p>Et se retrouver après <strong>exit</strong>   avec un état différent, effectivement la fonction <strong>exit </strong>appelle tous les destructeurs des objets en mémoire.</p>

<div class="sociable">
<span class="sociable_tagline">
<strong>Partager et découvrir :</strong>
	<span>Ces icônes sont des liens vers des sites de partage de signet sociaux où les lecteurs peuvent partager et découvrir de nouveaux liens.</span>
</span>
<ul>
	<li><a rel="nofollow" target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F04%2Fobjet-php-attention-au-__destruct%2F&amp;title=Objet%20PHP%20%3A%20attention%20au%20__destruct" title="bodytext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/digg.png" title="bodytext" alt="bodytext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://del.icio.us/post?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F04%2Fobjet-php-attention-au-__destruct%2F&amp;title=Objet%20PHP%20%3A%20attention%20au%20__destruct" title="del.icio.us"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F04%2Fobjet-php-attention-au-__destruct%2F&amp;title=Objet%20PHP%20%3A%20attention%20au%20__destruct&amp;popup=no" title="Netvouz"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F04%2Fobjet-php-attention-au-__destruct%2F&amp;title=Objet%20PHP%20%3A%20attention%20au%20__destruct" title="description"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/dzone.png" title="description" alt="description" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.thisnext.com/pick/new/submit/sociable/?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F04%2Fobjet-php-attention-au-__destruct%2F&amp;name=Objet%20PHP%20%3A%20attention%20au%20__destruct" title="ThisNext"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/thisnext.png" title="ThisNext" alt="ThisNext" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F04%2Fobjet-php-attention-au-__destruct%2F&amp;bm_description=Objet%20PHP%20%3A%20attention%20au%20__destruct&amp;plugin=soc" title="MisterWong"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/misterwong.gif" title="MisterWong" alt="MisterWong" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://wists.com/s.php?c=&amp;r=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F04%2Fobjet-php-attention-au-__destruct%2F&amp;title=Objet%20PHP%20%3A%20attention%20au%20__destruct" title="Wists"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wists.png" title="Wists" alt="Wists" class="sociable-hovers sociable_wists" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.scoopeo.com/scoop/new?newurl=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F04%2Fobjet-php-attention-au-__destruct%2F&amp;title=Objet%20PHP%20%3A%20attention%20au%20__destruct" title="Scoopeo"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/scoopeo.png" title="Scoopeo" alt="Scoopeo" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F04%2Fobjet-php-attention-au-__destruct%2F" title="Technorati"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" target="_blank" href="http://www.wikio.com/vote?url=http%3A%2F%2Floogaroo.net%2F2007%2F09%2F04%2Fobjet-php-attention-au-__destruct%2F" title="Wikio"><img src="http://loogaroo.net/wp-content/plugins/sociable/images/wikio.gif" title="Wikio" alt="Wikio" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://loogaroo.net/2007/09/04/objet-php-attention-au-__destruct/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

