1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| require_once ("C:/Program Files/EasyPHP-5.3.6.0/www/test/jpgraph/jpgraph.php");
require_once ("C:/Program Files/EasyPHP-5.3.6.0/www/test/jpgraph/jpgraph_line.php");
define('MYSQL_HOST', 'localhost');
define('MYSQL_USER', 'root');
define('MYSQL_PASS', '');
define('MYSQL_DATABASE', 'projet_orange');
$tableau_heure = array('0h','1h', '2h', '3h', '4h', '5h', '6h', '7h', '8h', '9h', '10h', '11h', '12h','13h', '14h', '15h', '16h', '17h', '18h', '19h', '20h', '21h', '22h','23h');
$sql_noise_par_heure = "SELECT [noise] AS bruit,[heure] AS HOUR FROM noise_level WHERE [id_adresse] =\'1\'";
$mysqlCnx = @mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) or die('Pb de connxion mysql');
@mysql_select_db(MYSQL_DATABASE) or die('Pb de sélection de la base');
$tableau_noise= array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
$mysqlQuery = @mysql_query($sql_noise_par_heure, $mysqlCnx) or die('Pb de requête');
while ($row = mysql_fetch_array($mysqlQuery, MYSQL_ASSOC)) {
$tableau_noise[$row['HOUR']] = $row['bruit'];
} |
Partager