forked from halo-battle/game
Version 0.9b
This commit is contained in:
parent
59fbc7104e
commit
73645ccc1f
25 changed files with 841 additions and 466 deletions
17
cron/classement.php
Normal file
17
cron/classement.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
require('../connectBDD.php');
|
||||
require('../fonctions.php');
|
||||
|
||||
mysql_query("TRUNCATE TABLE `classement`");
|
||||
$req = mysql_query("SELECT id, pseudo, race FROM user"); $resultat = mysql_fetch_array($req);
|
||||
while ($res = mysql_fetch_assoc($req)) {
|
||||
$pts_rech = CalculPointRecherche($res['id']);
|
||||
$pts_flotte = CalculPointflotte($res['id']);
|
||||
$pts_bat = CalculPointBatiment($res['id']);
|
||||
$pts_tt = $pts_rech + $pts_flotte + $pts_bat;
|
||||
|
||||
mysql_query("INSERT INTO `classement` (`pseudo`,`race`,`points`,`flottes`,`recherches`,`batiments`) VALUES ('".$res['pseudo']."', '".$res['race']."', '$pts_tt', '$pts_flotte', '$pts_rech', '$pts_bat');");
|
||||
}
|
||||
|
||||
mysql_close();
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue