<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ottimizzare Mysql con php]]></title><description><![CDATA[<p dir="auto">Ciao ragazzuoli esiste uno script che mi permette di ottimizzare il db da una pagina php?</p>
<p dir="auto">perchè molte volte trovo scomodo doverlo fare tramite db stesso.</p>
<p dir="auto">una altra cosa come mai c'è questo problema che le tabelle hanno un surplus di dati? deriva da me o dal db stesso??</p>
<p dir="auto">thx^_^</p>
]]></description><link>https://dev.connect.gt/topic/18507/ottimizzare-mysql-con-php</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 21:14:08 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/18507.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 09 Oct 2006 13:58:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ottimizzare Mysql con php on Thu, 26 Oct 2006 17:04:26 GMT]]></title><description><![CDATA[<p dir="auto">Prova questo script:<br />
&lt;?<br />
if (!ini_get('safe_mode')) {<br />
set_time_limit(2400);<br />
}<br />
$host="localhost";<br />
//oppure $host="192.168.0.1";<br />
$user ="nome utente amministratore db";<br />
$pass = "password utente";<br />
$DB_name="nome del database da ottimizzare";<br />
$msg="";<br />
$link = mysql_connect($host,$user,$pass);<br />
if ( ! $link ) die("Errore ...impossibile connettersi a MYSQL");<br />
if(<a href="mailto:!@mysql_select_db($DB_name,$link)" rel="nofollow ugc">!@mysql_select_db($DB_name,$link</a>) die("Errore ...impossibile connettersi al DataBase".mysql_error());<br />
}<br />
echo &lt;&lt;&lt;EOT<br />
&lt;html&gt;&lt;head&gt;&lt;title&gt;Ottimizzazione Tabelle&lt;/title&gt;<br />
&lt;STYLE TYPE="text/css"&gt;<br />
BODY{BACKGROUND-COLOR: <a href="/hashtags/dfdfd1">#dfdfd1</a>;FONT:BOLDER 14px VERDANA,ARIAL,MS Sans Serif;color:red;}<br />
&lt;/STYLE&gt;<br />
&lt;/head&gt;<br />
&lt;body &gt;<br />
&lt;center&gt;<br />
&lt;h3&gt;Ottimizzazione Tabelle&lt;br&gt; $DB_user&lt;/h3&gt;<br />
&lt;p&gt;<br />
EOT;<br />
$query="SHOW TABLE STATUS FROM $DB_name ";<br />
$result=  mysql_query ($query) or die ("errore : ". mysql_error() );<br />
if(mysql_num_rows($result)){<br />
while($row=mysql_fetch_array($result)){<br />
$query='OPTIMIZE TABLE '.$row[0];<br />
$result1=mysql_query($query) or die("errore : ". mysql_error()."\n");<br />
$row1=mysql_fetch_row($result1);<br />
if($row1[2]!='status') echo  "Tabella: $row[0] &lt;br&gt; - $row1[2]: $row1[3]&lt;br&gt;";<br />
else echo "Tabella: $row[0] O.K.&lt;br&gt;";<br />
}<br />
}<br />
echo &lt;&lt;&lt;EOT<br />
&lt;script&gt;<br />
alert("Ottimizzazione O.K.")<br />
self.close()<br />
&lt;/script&gt;<br />
EOT;<br />
exit;<br />
?&gt;</p>
<p dir="auto">Io lo uso da tempo e funziona<br />
Ciao cirpack</p>
]]></description><link>https://dev.connect.gt/post/379195</link><guid isPermaLink="true">https://dev.connect.gt/post/379195</guid><dc:creator><![CDATA[cirpack]]></dc:creator><pubDate>Thu, 26 Oct 2006 17:04:26 GMT</pubDate></item><item><title><![CDATA[Reply to ottimizzare Mysql con php on Wed, 18 Oct 2006 08:01:09 GMT]]></title><description><![CDATA[<p dir="auto">Puoi fare una prova, prima della mysql_query fai:</p>
<p dir="auto">echo $SQL;</p>
<p dir="auto">E vedi cosa ti scrive, poi, se ti sembra corretto, lo vai a scrivere in phpmyadmin e vedi cosa ti risponde e se effettivamente fa quello che ti aspetti!</p>
]]></description><link>https://dev.connect.gt/post/379193</link><guid isPermaLink="true">https://dev.connect.gt/post/379193</guid><dc:creator><![CDATA[senamion]]></dc:creator><pubDate>Wed, 18 Oct 2006 08:01:09 GMT</pubDate></item><item><title><![CDATA[Reply to ottimizzare Mysql con php on Wed, 18 Oct 2006 06:11:29 GMT]]></title><description><![CDATA[<p dir="auto">tu dici che funge ma a me non ottimizza nada....:S sei sicuro di ciò che dici?</p>
]]></description><link>https://dev.connect.gt/post/379189</link><guid isPermaLink="true">https://dev.connect.gt/post/379189</guid><dc:creator><![CDATA[massimux]]></dc:creator><pubDate>Wed, 18 Oct 2006 06:11:29 GMT</pubDate></item><item><title><![CDATA[Reply to ottimizzare Mysql con php on Sun, 15 Oct 2006 16:41:59 GMT]]></title><description><![CDATA[<p dir="auto">ah già... un lapsus, è che io sn abituato ad usare quelle variabili x quei dati. cmq l'ho provato e funziona!</p>
]]></description><link>https://dev.connect.gt/post/379202</link><guid isPermaLink="true">https://dev.connect.gt/post/379202</guid><dc:creator><![CDATA[christrato]]></dc:creator><pubDate>Sun, 15 Oct 2006 16:41:59 GMT</pubDate></item><item><title><![CDATA[Reply to ottimizzare Mysql con php on Sun, 15 Oct 2006 12:41:12 GMT]]></title><description><![CDATA[<p dir="auto">massy puoi verificare se funge? ti prego perchè a me nn va</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cristiano" aria-label="Profile: cristiano">@<bdi>cristiano</bdi></a></p>
<p dir="auto">ma che dici? ti rendi conto che così facendo imposterei variabili inesistenti?:D</p>
<p dir="auto">a buon rendere</p>
]]></description><link>https://dev.connect.gt/post/379188</link><guid isPermaLink="true">https://dev.connect.gt/post/379188</guid><dc:creator><![CDATA[massimux]]></dc:creator><pubDate>Sun, 15 Oct 2006 12:41:12 GMT</pubDate></item><item><title><![CDATA[Reply to ottimizzare Mysql con php on Sun, 15 Oct 2006 00:44:21 GMT]]></title><description><![CDATA[<p dir="auto">$db = mysql_connect($host, $user, $pass);</p>
<p dir="auto">deve essere così:</p>
<p dir="auto">$db = mysql_connect($db_host, $db_user, $db_pass);</p>
<p dir="auto">E perché?</p>
]]></description><link>https://dev.connect.gt/post/379177</link><guid isPermaLink="true">https://dev.connect.gt/post/379177</guid><dc:creator><![CDATA[massy]]></dc:creator><pubDate>Sun, 15 Oct 2006 00:44:21 GMT</pubDate></item><item><title><![CDATA[Reply to ottimizzare Mysql con php on Sat, 14 Oct 2006 17:10:40 GMT]]></title><description><![CDATA[<p dir="auto">$db = mysql_connect($host, $user, $pass);</p>
<p dir="auto">deve essere così:</p>
<p dir="auto">$db = mysql_connect($db_host, $db_user, $db_pass);</p>
<p dir="auto">cmq il resto mi sembra sia corretto xchè l'ho provato e funziona.</p>
]]></description><link>https://dev.connect.gt/post/379201</link><guid isPermaLink="true">https://dev.connect.gt/post/379201</guid><dc:creator><![CDATA[christrato]]></dc:creator><pubDate>Sat, 14 Oct 2006 17:10:40 GMT</pubDate></item><item><title><![CDATA[Reply to ottimizzare Mysql con php on Wed, 11 Oct 2006 06:06:08 GMT]]></title><description><![CDATA[<pre><code class="language-php">&lt;?
$host = "host_database";
$user = "username";
$pass = "password";
$db_name = "nome_del_database";


$db = mysql_connect($host, $user, $pass);
mysql_select_db($db_name, $db);


   echo "Ottimizzazione DataBase in corso...";
   $SQL = "OPTIMIZE TABLE ";
   $result = mysql_list_tables($db_name);
   $i = 0;
   while ($i &lt; mysql_num_rows($result)) {
      $name_table = mysql_tablename($result, $i);
      echo "Ottimizzazione tabella: $name_table .....&lt;BR&gt;";
      $SQL .=  $name_table;
      $SQL .= ",";
      $i++;
   }
   $SQL = substr($SQL,0,strlen($SQL)-1);
   $result_set = mysql_query($SQL);
   mysql_free_result($result_set);

?&gt;
</code></pre>
<p dir="auto">ragazzi dopo aver sistemato lo script per un errorino ora mi trovo questo errore:</p>
<p dir="auto">il valore dato per mysql_free_result() non è giusto/corretto.</p>
<p dir="auto">qualcuno può controllarlo? thx^_^</p>
]]></description><link>https://dev.connect.gt/post/379183</link><guid isPermaLink="true">https://dev.connect.gt/post/379183</guid><dc:creator><![CDATA[massimux]]></dc:creator><pubDate>Wed, 11 Oct 2006 06:06:08 GMT</pubDate></item><item><title><![CDATA[Reply to ottimizzare Mysql con php on Tue, 10 Oct 2006 06:17:22 GMT]]></title><description><![CDATA[<pre><code class="language-php">&lt;?
$host = "host_database";
$user = "username";
$pass = "password";
$db_name = "nome_del_database";


$db = mysql_connect($host, $user, $pass);
mysql_select_db($db_name, $db);


   echo "Ottimizzazione DataBase in corso...";
   $SQL = "OPTIMIZE TABLE ";
   $result = mysql_list_tables($DATABASE);
   $i = 0;
   while ($i &lt; mysql_num_rows($result)) {
      $name_table = mysql_table_name($result, $i);
      echo "Ottimizzazione tabella: $name_table .....&lt;BR&gt;";
      $SQL .=  $name_table;
      $SQL .= ",";
      $i++;
   }
   $SQL = substr($SQL,0,strlen($SQL)-1);
   $result_set = mysql_query($SQL);
   mysql_free_result($result_set);

?&gt;
</code></pre>
<p dir="auto">a chiunque servisse^_^</p>
]]></description><link>https://dev.connect.gt/post/379181</link><guid isPermaLink="true">https://dev.connect.gt/post/379181</guid><dc:creator><![CDATA[massimux]]></dc:creator><pubDate>Tue, 10 Oct 2006 06:17:22 GMT</pubDate></item><item><title><![CDATA[Reply to ottimizzare Mysql con php on Mon, 09 Oct 2006 21:59:38 GMT]]></title><description><![CDATA[<p dir="auto"><a href="http://dev.mysql.com/doc/refman/4.1/en/optimize-table.html" rel="nofollow ugc">http://dev.mysql.com/doc/refman/4.1/en/optimize-table.html</a></p>
<p dir="auto"><img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/54a3bffb-5e4a-4eb8-81dc-99b2072e5d05-175.gif?v=12b9555a9a1" class="not-responsive emoji emoji-customizations emoji--ciauz" style="height:1.4em;width:auto;vertical-align:middle" title=":ciauz:" alt="" /></p>
]]></description><link>https://dev.connect.gt/post/379176</link><guid isPermaLink="true">https://dev.connect.gt/post/379176</guid><dc:creator><![CDATA[massy]]></dc:creator><pubDate>Mon, 09 Oct 2006 21:59:38 GMT</pubDate></item><item><title><![CDATA[Reply to ottimizzare Mysql con php on Mon, 09 Oct 2006 17:11:34 GMT]]></title><description><![CDATA[<p dir="auto">non so creare quelle poche righe nel senso che non so che funzione o altro adoperare^_^</p>
]]></description><link>https://dev.connect.gt/post/379178</link><guid isPermaLink="true">https://dev.connect.gt/post/379178</guid><dc:creator><![CDATA[massimux]]></dc:creator><pubDate>Mon, 09 Oct 2006 17:11:34 GMT</pubDate></item><item><title><![CDATA[Reply to ottimizzare Mysql con php on Mon, 09 Oct 2006 14:05:46 GMT]]></title><description><![CDATA[<p dir="auto">Ti puoi creare tu stesso alcune righe in php che aprono la connessione e fanno l'optimize delle tabelle. Sono poche righe di codice.<br />
Le tabelle hanno un surplus di dati in caso di cancellazioni in quanto al momento del delete i dati non vengon fisicamente cancellati ma solo flaggati come "deleted". Vengono poi riutilizzati da nuovi inserimenti (e quindi non si perde spazio)</p>
]]></description><link>https://dev.connect.gt/post/379190</link><guid isPermaLink="true">https://dev.connect.gt/post/379190</guid><dc:creator><![CDATA[senamion]]></dc:creator><pubDate>Mon, 09 Oct 2006 14:05:46 GMT</pubDate></item></channel></rss>