<?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>usthere&#039;s Blog</title>
	<atom:link href="http://www.usthere.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.usthere.com</link>
	<description></description>
	<lastBuildDate>Tue, 24 Aug 2010 20:59:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Usare &#8220;Custom Field&#8221; nel content</title>
		<link>http://www.usthere.com/usare-custom-field-nel-content.html</link>
		<comments>http://www.usthere.com/usare-custom-field-nel-content.html#comments</comments>
		<pubDate>Mon, 08 Mar 2010 10:23:59 +0000</pubDate>
		<dc:creator>Michele</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://usthere.comoj.com/?p=221</guid>
		<description><![CDATA[Cercando di scrivere il mio plugin per wordpress mi sono imbattuto in un problema che, all'apparenza stupido, di stupido ha poco ( a mio modesto parere ovviamente!). Sarà sicuramente capitato anche a voi, di aver visto plugin che una volta attivati,per la visualizzazione dei dati, pretendono di avere pagine a loro dedicate nelle quali sono [...]]]></description>
			<content:encoded><![CDATA[<p>Cercando di scrivere il mio plugin per wordpress mi sono imbattuto in un problema che, all'apparenza stupido, di stupido ha poco ( a mio modesto parere ovviamente!). Sarà sicuramente capitato anche a voi, di aver visto plugin che una volta attivati,per la visualizzazione dei dati, pretendono di avere pagine a loro dedicate nelle quali sono presenti tag in questo formato : "[tag]".</p>
<p>Come questi plugin a capire quando sono interpellati?! Bene, me lo sono chiesto e sinceramente non credo ancora di averlo capito, ma CREDO che procedano così:</p>
<blockquote><p>add_filter('the_content','ricerca_tag');</p></blockquote>
<p>creo un filtro per cui ogni volta che viene chiamato in wordpress "the content"(praticamente ad ogni visualizzazione di pagine o articoli) viene chiamata la mia funzione ricerca_tag.</p>
<blockquote><p>function ricerca_tag($content) {<br />
if (substr_count($content, '[TAG]'))<br />
$content=str_ireplace('[TAG]',TEST_TAG(),$content);<br />
return $content;<br />
}</p>
<p>function TEST_TAG() {<br />
return "HA FUNZIONATO!!";<br />
}</p></blockquote>
<p>semplicemente ricerco all'interno di quello che sto per stampare se è presente il mio "[TAG]", e se lo trova lo rimpiazza con quello che ritorna la funzione TEST_TAG, che altro non fa che ritornare una stringa di testo!</p>
<p>Ovviamente questo metodo non so se è il metodo giusto, o il più efficace, è quello che sto usando io <img src='http://www.usthere.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>ATTENZIONE bisogna far attenzione nella stesura del codice poichè una funzione "ricerca_tag"  troppo pesante o gravosa (esempio ricerca di 100 tag) potrebbe causare rallentamenti consistenti del blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.usthere.com/usare-custom-field-nel-content.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Contatori e qualche tips su tabelle</title>
		<link>http://www.usthere.com/contatori-e-qualche-tips-su-tabelle.html</link>
		<comments>http://www.usthere.com/contatori-e-qualche-tips-su-tabelle.html#comments</comments>
		<pubDate>Tue, 20 Oct 2009 10:30:00 +0000</pubDate>
		<dc:creator>Michele</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[auto_increment]]></category>
		<category><![CDATA[contatori]]></category>
		<category><![CDATA[modificare ordine campi]]></category>
		<category><![CDATA[resettare contatore]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=187</guid>
		<description><![CDATA[In Mysql esiste una proprietà del campo int che si chiama AUTO_INCREMENT, che permette senza nessun tipo di sforzo di gestire ID univoci, senza bisogno di nessun altro accorgimento. A questo punto che senso ha parlare di auto_increment? Questa proprietà offre numerosi vantaggi, ma per utilizzarla appieno bisogna conoscerne almeno anche qualche caratteristica, il contatore [...]]]></description>
			<content:encoded><![CDATA[<p>In Mysql esiste una proprietà del campo int che si chiama AUTO_INCREMENT, che permette senza nessun tipo di sforzo di gestire ID univoci, senza bisogno di nessun altro accorgimento.<br />
A questo punto che senso ha parlare di auto_increment? <img src='http://www.usthere.com/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Questa proprietà offre numerosi vantaggi, ma per utilizzarla appieno bisogna conoscerne almeno anche qualche caratteristica, il contatore parte per default da 1, e memorizza il max(id) così da immettere automaticamente un id che non è stato mai usato prima, ma se ho ad esempio 5 campi numerati da 1 a 5 e cancello i record con id 4,5 che numero avrà l'id successivo? ovvio: 6! <img src='http://www.usthere.com/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
e se volessi ricominciare dal primo numero dopo X? a questo punto ci viene comodo sapere che esiste una "variabile" dedicata alla tabella nella quale specificare il numero dal quale incominciare per iniziare una numerazione:<br />
ALTER TABLE nomeTabella AUTO_INCREMENT = X<br />
Se invece, come mi capita spesso, ho un campo id con valori veramente distribuiti a caso, il modo più veloce che conosco è, per non modificare l'ordine dei record, aggiungere una colonna ID_TMP auto_increment e successivamente cancellare la vecchia..<br />
per prima cosa quindi, visto che non possiamo avere due primary key in una tabella eliminiamo il riferimento alla primary key del vecchio id con</p>
<blockquote><p><span style="font-size: 78%;">ALTER TABLE `test` CHANGE `ID` `ID` INT( 11 ) NOT NULL ;<br />
ALTER TABLE `test` DROP PRIMARY KEY </span></p></blockquote>
<p>la prima riga serve perchè una colonna con valore automatico DEVE essere una chiave della tabella <img src='http://www.usthere.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
poi aggiungiamo un nuovo campo autoincrementale</p>
<blockquote><p><span style="font-size: 78%;">ALTER TABLE `test` ADD `ID_TMP` INT NOT NULL AUTO_INCREMENT ,ADD PRIMARY KEY(`ID_TMP`)</span></p></blockquote>
<p>eliminiamo il vecchio id e cambiamo nome al temp e il gioco è fatto!</p>
<blockquote><p><span style="font-size: 78%;">ALTER TABLE `test` DROP `ID`<br />
ALTER TABLE `test` CHANGE `ID_TMP` `ID` INT NOT NULL AUTO_INCREMENT </span></p></blockquote>
<p>a questo punto la domanda è lecita.. e se volessimo partire da 0?<br />
la procedura è pressocchè la stessa,ma dobbiamo stare attenti ad un paio di cose, quando creiamo l'indice ausiliario lo dobbiamo dichiarare INT e basta:</p>
<blockquote><p><span style="font-size: 78%;">ALTER TABLE `test` ADD `ID_TMP` INT</span></p></blockquote>
<p>poi mettiamo a 0 il suo indice più basso:</p>
<blockquote><p><span style="font-size: 78%;">select MIN(`ID`) from `test` into @a;<br />
UPDATE `test` SET `ID_TMP` = '0' WHERE `test`.`ID` = @a</span></p></blockquote>
<p>quindi eliminiamo il primary key ed auto_increment dell' ID vecchio</p>
<blockquote><p><span style="font-size: 78%;">ALTER TABLE `test` CHANGE `ID` `ID` INT( 11 ) NOT NULL ;<br />
ALTER TABLE `test` DROP PRIMARY KEY </span></p></blockquote>
<p>e l'impostiamo al nuovo facendo attenzione alla prima riga! infatti stiamo dicendo a mysql di non auto_suggerirci un nuovo valore quando incontra lo 0:</p>
<blockquote><p><span style="font-size: 78%;">SET sql_mode="NO_AUTO_VALUE_ON_ZERO";<br />
ALTER TABLE `test` MODIFY `ID_TMP` INT NOT NULL AUTO_INCREMENT  ,ADD PRIMARY KEY(`ID_TMP`)</span></p></blockquote>
<p>poi procediamo come prima, eliminiamo la colonna ID e rinominiamo ID_TMP in ID <img src='http://www.usthere.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<blockquote><p><span style="font-size: 78%;">ALTER TABLE `test` DROP `ID`;<br />
ALTER TABLE `test` CHANGE `ID_TMP` `ID` INT NOT NULL AUTO_INCREMENT</span></p></blockquote>
<p>et voià! il gioco è fatto!</p>
<p>EDIT:<br />
mi sono scordato una cosa "importante" e cioè rimettere l'ID della tabella come primo campo!!</p>
<blockquote><p><span style="font-size: 78%;">ALTER TABLE test MODIFY COLUMN ID int FIRST</span></p></blockquote>
<p>questo è un comando non tanto conosciuto, ma comodo.. ricordatevi però di mettere il valore del campo in modo giusto!! (int per i numeri varchar per i campi alfanumerici )<br />
intanto che ci siamo vi illustro anche come mettere un campo prima o dopo un altro, se per caso l'ordine di una tabella fosse: secondo,primo,ID potremmo agevolmente con il primo comando mettere l'id all'inizio e poi con questo:</p>
<blockquote><p><span style="font-size: 78%;">ALTER TABLE test MODIFY COLUMN secondo varchar(255) AFTER primo</span></p></blockquote>
<p>ripristinare l'ordine naturale: ID,primo,secondo <img src='http://www.usthere.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.usthere.com/contatori-e-qualche-tips-su-tabelle.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GROUP_CONCAT tips 2 – il ritorno</title>
		<link>http://www.usthere.com/group_concat-tips.html</link>
		<comments>http://www.usthere.com/group_concat-tips.html#comments</comments>
		<pubDate>Sat, 05 Sep 2009 08:19:00 +0000</pubDate>
		<dc:creator>Michele</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[group_concat]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=184</guid>
		<description><![CDATA[un modo produttivo per usare i group_concat è creare delle views specifiche avendo così tutti i dati in un unica "tabella", ma come fare per fare delle select sui valori ritornati da group_concat?il campo è considerato varchar fino al valore di group_concat_max_len è maggiore di 512, altrimenti è considerato BLOB, quindi si può usare una [...]]]></description>
			<content:encoded><![CDATA[<p>un modo produttivo per usare i group_concat è creare delle views specifiche avendo così tutti i dati in un unica "tabella", ma come fare per fare delle select sui valori ritornati da group_concat?<br />il campo è considerato varchar fino al valore di group_concat_max_len è maggiore di 512, altrimenti è considerato BLOB, quindi si può usare una clausola where in questo modo:</p>
<blockquote><p><span style="font-size:78%;">select * from vestiti<br />where (taglie like 'l' or taglie like '%,l,%' or taglie like '%,l' or taglie like 'l,%' ) and (colori like 'rosso' or colori like '%,rosso,%' or colori like '%,rosso' or colori like 'rosso,%' ) </span></p></blockquote>
<p>p.s.<br />vestiti è la nostra view, in questo caso specifico voglio avere tutti i vestiti che hanno taglia L e colore rosso</p>
]]></content:encoded>
			<wfw:commentRss>http://www.usthere.com/group_concat-tips.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GROUP_CONCAT tips</title>
		<link>http://www.usthere.com/183.html</link>
		<comments>http://www.usthere.com/183.html#comments</comments>
		<pubDate>Wed, 02 Sep 2009 16:50:00 +0000</pubDate>
		<dc:creator>Michele</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[group_concat]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=183</guid>
		<description><![CDATA[l'altro giorno mi sono imbattuto in un piccolo "problema" di visualizzazione di risultati di una query.. in particolare, cosa succede quando ho una relazione molti a molti su due tabelle? in generale si crea una tabella "intermediario" nella quale si gestiscono le varie relazioni.. è qui che sorge il "problema" e cioè: normalmente cosa succede [...]]]></description>
			<content:encoded><![CDATA[<p>l'altro giorno mi sono imbattuto in un piccolo "problema" di visualizzazione di risultati di una query..<br />
in particolare, cosa succede quando ho una relazione molti a molti su due tabelle? in generale si crea una tabella "intermediario"<br />
nella quale si gestiscono le varie relazioni.. è qui che sorge il "problema" e cioè: normalmente cosa succede quando si fa una select?<br />
i risultati vengono spianati su varie righe, proprio perchè (per definizione) ad un record della tabella 1<br />
corrispondono più record della tabella 2!<br />
ma vediamo in particolare con un esempio come funziona questa comoda funzione (non standard)<br />
le tabelle saranno:</p>
<blockquote><p><span style="font-size: 78%;">CREATE TABLE `prodotti` (<br />
`ID` int(10) unsigned NOT NULL auto_increment,<br />
`nome` varchar(255) NOT NULL,<br />
PRIMARY KEY  (`ID`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=utf8</span></p>
<p>CREATE TABLE `valori_attributo` (<br />
`ID` int(10) unsigned NOT NULL auto_increment,<br />
`valore` varchar(255) NOT NULL,<br />
`tipo` varchar(255) NOT NULL,<br />
PRIMARY KEY  (`ID`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=utf8</p>
<p>CREATE TABLE `valori_prodotti` (<br />
`ID` int(10) unsigned NOT NULL auto_increment,<br />
`ID_prodotto` int(10) unsigned NOT NULL default '0',<br />
`ID_valore_attributo` int(10) unsigned NOT NULL default '0',<br />
PRIMARY KEY  (`ID`)<br />
) ENGINE=MyISAM DEFAULT CHARSET=utf8</p></blockquote>
<p>popoliamo un pò il db:<br />
<span style="font-size: 78%;"> </span></p>
<blockquote><p><span style="font-size: 78%;">insert into valori_attributo values (NULL,'rosso','colore'),(NULL,'blu','colore'),(NULL,'verde','colore'),(NULL,'giallo','colore'),(NULL,'M','taglia'),(NULL,'S','taglia'),(NULL,'L','taglia'),(NULL,'XL','taglia')</span></p>
<p>insert into prodotti values (NULL,'maglia corta'),(NULL,'maglia maniche lunghe'),(NULL,'pullover')</p>
<p>insert into valori_prodotti values (NULL,(select ID from prodotti where nome = 'pullover'),(select ID from valori_attributo where valore = 'XL')),(NULL,(select ID from prodotti where nome = 'pullover'),(select ID from valori_attributo where valore = 'S')),(NULL,(select ID from prodotti where nome = 'pullover'),(select ID from valori_attributo where valore = 'L')),(NULL,(select ID from prodotti where nome = 'pullover'),(select ID from valori_attributo where valore = 'rosso')),(NULL,(select ID from prodotti where nome = 'pullover'),(select ID from valori_attributo where valore = 'blu')),(NULL,(select ID from prodotti where nome = 'pullover'),(select ID from valori_attributo where valore = 'verde')),(NULL,(select ID from prodotti where nome = 'maglia corta'),(select ID from valori_attributo where valore = 'giallo')),(NULL,(select ID from prodotti where nome = 'maglia corta'),(select ID from valori_attributo where valore = 'M'))</p></blockquote>
<p>in questo esempio se avessimo voluto tutti i prodotti con a lato i relativi valori attributo la cosa più naturale da scrivere<br />
sarebbe qualcosa del tipo:</p>
<blockquote><p><span style="font-size: 78%;">select (select nome from prodotti where ID = ID_prodotto) as prodotto,(select valore from valori_attributo where ID = ID_valore_attributo) as valore from valori_prodotti </span></p></blockquote>
<p>che produce un risultato simile a questo:</p>
<blockquote>
<table border="1" cellspacing="0" cellpadding="0" width="200">
<tbody>
<tr>
<td>prodotto</td>
<td>valore</td>
</tr>
<tr>
<td>pullover</td>
<td>XL</td>
</tr>
<tr>
<td>pullover</td>
<td>S</td>
</tr>
<tr>
<td>pullover</td>
<td>L</td>
</tr>
<tr>
<td>pullover</td>
<td>rosso</td>
</tr>
<tr>
<td>pullover</td>
<td>blu</td>
</tr>
<tr>
<td>pullover</td>
<td>verde</td>
</tr>
<tr>
<td>maglia corta</td>
<td>giallo</td>
</tr>
<tr>
<td>maglia corta</td>
<td>M</td>
</tr>
</tbody>
</table>
</blockquote>
<p>mentre con questa bellissima istruzione:<br />
<span style="font-size: 78%;"> </span></p>
<blockquote><p><span style="font-size: 78%;">select prodotti.nome, GROUP_CONCAT(DISTINCT (select valore from valori_attributo where valori_prodotti.ID_valore_attributo = valori_attributo.ID and valori_attributo.tipo = 'colore') SEPARATOR ',') as colore, GROUP_CONCAT(DISTINCT (select valore from valori_attributo where valori_prodotti.ID_valore_attributo = valori_attributo.ID and valori_attributo.tipo = 'taglia') SEPARATOR ',') as taglie  from valori_prodotti,prodotti<br />
where valori_prodotti.ID_prodotto = prodotti.ID group by prodotti.ID </span></p></blockquote>
<p>avremo questo risultato:</p>
<blockquote>
<table border="1" cellspacing="0" cellpadding="0" width="300">
<tbody>
<tr>
<td>nome</td>
<td>colore</td>
<td>taglie</td>
</tr>
<tr>
<td>maglia corta</td>
<td>giallo</td>
<td>M</td>
</tr>
<tr>
<td>pullover</td>
<td>rosso,blu,verde</td>
<td>XL,S,L</td>
</tr>
</tbody>
</table>
</blockquote>
<p>carino no? <img src='http://www.usthere.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.usthere.com/183.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsare html nel blog</title>
		<link>http://www.usthere.com/parsare-html-nel-blog.html</link>
		<comments>http://www.usthere.com/parsare-html-nel-blog.html#comments</comments>
		<pubDate>Tue, 04 Aug 2009 10:24:00 +0000</pubDate>
		<dc:creator>Michele</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[parsare html]]></category>
		<category><![CDATA[parsing]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=182</guid>
		<description><![CDATA[Blogcrowds fornisce un comodo parser di html per pubblicare del codice html sul proprio bloghttp://blogcrowds.com/resources/parse_html.php]]></description>
			<content:encoded><![CDATA[<p>Blogcrowds fornisce un comodo parser di html per pubblicare del codice html sul proprio blog<br /><a href="http://blogcrowds.com/resources/parse_html.php"><br />http://blogcrowds.com/resources/parse_html.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.usthere.com/parsare-html-nel-blog.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Array di checkbox in php</title>
		<link>http://www.usthere.com/array-di-checkbox-in-php.html</link>
		<comments>http://www.usthere.com/array-di-checkbox-in-php.html#comments</comments>
		<pubDate>Tue, 04 Aug 2009 10:10:00 +0000</pubDate>
		<dc:creator>Michele</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[checkbox]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=181</guid>
		<description><![CDATA[ecco un semplice modo per gestire checkbox multipli &#60;form method="post" action="form.php"&#62;&#60;input name="taglie[]" value="L" type="checkbox"&#62;&#60;input name="taglie[]" value="M" type="checkbox"&#62;&#60;input type="submit"&#62;&#60;/form&#62; e per recuperare i valori: for ($i=0; $i &#60; sizeof($HTTP_POST_VARS['taglie']); $i++) echo $HTTP_POST_VARS['taglie'][$i]; ovviamente può essere un metodo utilizzabile non solo per le chechbox ma per qualsiasi tipo di dato!]]></description>
			<content:encoded><![CDATA[<p>ecco un semplice modo per gestire checkbox multipli</p>
<blockquote><p>&lt;form method="post" action="form.php"&gt;<br />&lt;input name="taglie[]" value="L" type="checkbox"&gt;<br />&lt;input name="taglie[]" value="M" type="checkbox"&gt;<br />&lt;input type="submit"&gt;<br />&lt;/form&gt;</p></blockquote>
<p>e per recuperare i valori:</p>
<blockquote><p>for ($i=0; $i &lt; sizeof($HTTP_POST_VARS['taglie']); $i++)<br />   echo $HTTP_POST_VARS['taglie'][$i];</p></blockquote>
<p>ovviamente può essere un metodo utilizzabile non solo per le chechbox ma per qualsiasi tipo di dato!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.usthere.com/array-di-checkbox-in-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Schedulare procedure in MySQL usando SLEEP() e EXECUTE</title>
		<link>http://www.usthere.com/schedulare-procedure-in-mysql-usando-sleep-e-execute.html</link>
		<comments>http://www.usthere.com/schedulare-procedure-in-mysql-usando-sleep-e-execute.html#comments</comments>
		<pubDate>Tue, 04 Aug 2009 09:55:00 +0000</pubDate>
		<dc:creator>Michele</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[execute]]></category>
		<category><![CDATA[mysql scheduling]]></category>
		<category><![CDATA[Roland Bouman]]></category>
		<category><![CDATA[sleep()]]></category>
		<category><![CDATA[stored procedure]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=180</guid>
		<description><![CDATA[un interessantissimo articolo del "guru" informatico Roland Bouman che spiega in dettaglio come automatizzare procedure in MySQL 5.0 (in MySQL 5.1 è supportato nativamente)in sostanza crea una tabella "job" nella quale verranno memorizzati i processi, e usa una procedura job&#38;run che in loop attiva/disattiva i processi.. http://rpbouman.blogspot.com/2005/10/scheduling-procedure-execution-in.html p.s.non ho idea del carico di lavoro che [...]]]></description>
			<content:encoded><![CDATA[<p>un interessantissimo articolo del "guru" informatico<span style="font-weight: bold;"> </span>Roland Bouman che spiega in dettaglio come automatizzare procedure in MySQL 5.0 (in MySQL 5.1 è supportato nativamente)<br /><span style="font-weight: bold;"><br /></span>in sostanza crea una tabella<span style="font-weight: bold;"> </span>"job" nella quale verranno memorizzati i processi, e usa una procedura job&amp;run che in loop attiva/disattiva i processi..</p>
<p><a href="http://rpbouman.blogspot.com/2005/10/scheduling-procedure-execution-in.html">http://rpbouman.blogspot.com/2005/10/scheduling-procedure-execution-in.html</a></p>
<p>p.s.<br />non ho idea del carico di lavoro che la procedura job&amp;run possa arrecare al server, se avrò modo di provarla vi farò sapere <img src='http://www.usthere.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> <br /><span style="font-weight: bold;"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.usthere.com/schedulare-procedure-in-mysql-usando-sleep-e-execute.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Query dinamiche con MySQL</title>
		<link>http://www.usthere.com/query-dinamiche-con-mysql.html</link>
		<comments>http://www.usthere.com/query-dinamiche-con-mysql.html#comments</comments>
		<pubDate>Tue, 04 Aug 2009 09:36:00 +0000</pubDate>
		<dc:creator>Michele</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[query dinamiche]]></category>
		<category><![CDATA[stored procedure]]></category>
		<category><![CDATA[trigger]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=179</guid>
		<description><![CDATA[con questa procedura è possibile automatizzare diversi tipi di procedure,l'unico mio problema ora è che se inserita all'interno di trigger non va a buon fine..funzionalità non ancora implementata in MySQL 5.0.51? tutti i tipi di procedure che non hanno al loro interno codice sql dinamico.. CREATE DEFINER=`root`@`localhost` PROCEDURE `eseguiQuery`(queryT VARCHAR(255))BEGINset @sql_text:=queryT;PREPARE stmt1 FROM @sql_text;EXECUTE stmt1;DEALLOCATE [...]]]></description>
			<content:encoded><![CDATA[<p>con questa procedura è possibile automatizzare <strike> diversi tipi di procedure,l'unico mio problema ora è che se inserita all'interno di trigger non va a buon fine..funzionalità non ancora implementata in MySQL 5.0.51?</strike> <br />tutti i tipi di procedure che non hanno al loro interno codice sql dinamico.. <br />
<blockquote>CREATE DEFINER=`root`@`localhost` PROCEDURE `eseguiQuery`(queryT VARCHAR(255))<br />BEGIN<br />set @sql_text:=queryT;<br />PREPARE stmt1 FROM @sql_text;<br />EXECUTE stmt1;<br />DEALLOCATE PREPARE stmt1;<br />END$$</p></blockquote>
<p>l'utilizzo è semplicissimo es:<br />(ovviamente qui è usata all'interno di un altra procedura)<br /><strike> <br />set queryAtt = CONCAT("ALTER TABLE `db`.`PROVA` MODIFY COLUMN `colonna` SET('a','b','c','d') DEFAULT NULL;");<br />CALL `db`.eseguiQuery(queryAtt);</strike> </p>
<blockquote><p>set queryAtt = CONCAT("select * from test.tabella");<br />CALL `db`.eseguiQuery(queryAtt);</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.usthere.com/query-dinamiche-con-mysql.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
