Je voulais savoir quelle fonction utiliser pour mettre en cache les données extraites et les rafraîchir après 15-30 minutes.Options de mise en cache pour le script php qui extrait les données des tables mysql
Voici le script php qui extrait les données de mysql vers le site Web.
<?php
include('mysql_connection.php');
$c = mysqlConnect();
$locale = $_GET['locale'];
$last_bulletins_id = $_GET['bulletins_id'];
sendQuery ("set character_set_results='utf8'");
sendQuery ("set collation_connection='utf8_general_ci'");
if(strcmp($locale,"en") != 0)
$locale = "en";
$result = sendQuery("
SELECT bulletins.id, posted_date, message, name
FROM bulletins
LEFT JOIN players ON (bulletins.player_id = players.user_id)
WHERE bulletins.id > ".$last_bulletins_id." and locale = '".$locale."'
ORDER BY bulletins.id DESC
LIMIT 10");
echo '<table width=\"100%\">';
while($row = mysql_fetch_array($result, MYSQL_NUM))
{
echo '<tr><td width=\"100%\"><b>Date: </b>'.$row[1].'</td></tr>';
echo '<tr><td width=\"100%\"><b>Author: </b>'.$row[3].'</td></tr>';
echo '<tr><td width=\"100%\">'.nl2br($row[2]).'</td></tr>';
echo '<tr><td width=\"100%\"><hr style="height: 2px; border: none; background: #515151;"></td></tr>';
}
echo '</table>';
mysqlClose($c);
?>