- <?php
- // Conexion database
- $SQL['address'] = 'localhost';
- $SQL['username'] = 'root';
- $SQL['password'] = '1234';
- $SQL['DB'] = 'dbname';
- try
- {
- $bdd = new PDO('mysql:host=' . $SQL['address'] . ';dbname=' . $SQL['DB'] . ';charset=utf8', $SQL['username'], $SQL['password']);
- }
- catch (Exception $e)
- {
- die('Erreur : ' . $e->getMessage());
- }
- // Récupération des datas
- $response = $bdd->query('select * from `T_Log_PingChecker` where `LPC_Compteur` = ( select max(`LPC_Compteur`) from `T_Log_PingChecker`)');
- // Affichage des données
- while($data = $response->fetch())
- {
- $Nom = $data['LPC_Nom'];
- $resultat = $data['LPC_Resultat'];
- $Compteur = $data['LPC_Compteur'];
- $ID = $data['LPC_ID'];
- if ($resultat > "Online")
- {
- //echo $Nom . " : " ;
- echo "<font color='red'> $Nom </font>" . " : ";
- echo $resultat;
- echo "<br>";
- }
- else
- {
- echo $Nom . " : " ;
- echo $resultat;
- echo "<br>";
- }
- }
- $response->closeCursor();
- ?>
Affichage des résultats