Ho questa pagina:
Codice:<div align="center"> <table border="1" width="550" id="table1" style="border-collapse: collapse"> <tr> <td colspan="5" bgcolor="#C0C0C0"> <p align="center"><font color="#FF0000" size="4">Probabili Formazioni</font></td> </tr> <tr> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">ASCOLI</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">CAGLIARI</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">CHIEVO</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">EMPOLI</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">FIORENTINA</font></b></td> </tr> <tr> <td align="center" width="110"><? include ("view_ascoli.php") ?></td> <td align="center" width="110"><? include ("view_cagliari.php") ?></td> <td align="center" width="110"><? include ("view_chievo.php") ?></td> <td align="center" width="110"><? include ("view_empoli.php") ?></td> <td align="center" width="110"><? include ("view_fiorentina.php") ?></td> </tr> <tr> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">INTER</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">JUVENTUS</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">LAZIO</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">LECCE</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">LIVORNO</font></b></td> </tr> <tr> <td align="center" width="110"><? include ("view_inter.php") ?></td> <td align="center" width="110"><? include ("view_juve.php") ?></td> <td align="center" width="110"><? include ("view_lazio.php") ?></td> <td align="center" width="110"><? include ("view_lecce.php") ?></td> <td align="center" width="110"><? include ("view_livorno.php") ?></td> </tr> <tr> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">MESSINA</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">MILAN</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">PALERMO</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">PARMA</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">REGGINA</font></b></td> </tr> <tr> <td align="center" width="110"><? include ("view_messina.php") ?></td> <td align="center" width="110"><? include ("view_milan.php") ?></td> <td align="center" width="110"><? include ("view_palermo.php") ?></td> <td align="center" width="110"><? include ("view_parma.php") ?></td> <td align="center" width="110"><? include ("view_reggina.php") ?></td> </tr> <tr> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">ROMA</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">SAMPDORIA</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">SIENA</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">TREVISO</font></b></td> <td align="center" width="110" bgcolor="#292E34"><b> <font color="#00FF00">UDINESE</font></b></td> </tr> <tr> <td align="center" width="110"><? include ("view_roma.php") ?></td> <td align="center" width="110"><? include ("view_sampdoria.php") ?></td> <td align="center" width="110"><? include ("view_siena.php") ?></td> <td align="center" width="110"><? include ("view_treviso.php") ?></td> <td align="center" width="110"><? include ("view_udinese.php") ?></td> </tr> </table> </div>
e ogni include prevede questo testo:
Codice PHP:
<?php
include("config.inc.php");
$db = mysql_connect($host, $username, $password) or die("Errore durante la connessione al database");
mysql_select_db($database, $db) or die("Errore durante la selezione del database");
$query = "SELECT * FROM `phpbb_posts_text` WHERE post_id = 2440";
$result = mysql_query($query, $db);
while ($row = mysql_fetch_array($result))
echo nl2br($row['post_text']);
mysql_close($db);
?>
mi sa che consumi parecchie query ad ogni accesso...come posso ottimizzare?mi dite qualche consiglio?grazie