kalimero a écrit :Tudgur a écrit :kalimero a écrit :
SELECT temp_min,date_temp_min,heure_temp_min FROM mois WHERE id='1010'
C'est WHERE id='$jour' ou WHERE id='$mois' selon le cas.
<?php
if (date("L") == 1 and date("z") >= 60) {$jour = date("z") + 1;
}
elseif (date("L") == 0 and date("z") >= 60) {$jour = date("z") + 2;
}
$mois=(1000 + date("n"));
$db = mysql_connect('bases.sql', 'xxxxx', 'xxxxxxxx');
mysql_query("set names UTF8");
mysql_select_db('bonux50-php',$db);
$sql = "SELECT temp_min,date_temp_min,heure_temp_min FROM extremes WHERE id='$jour'";
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
while($data = mysql_fetch_assoc($req))
{
$temp_min=$data['temp_min'];
$date_temp_min=$data['date_temp_min'];
$heure_temp_min=$data['heure_temp_min'];
$sql = "SELECT temp_min,date_temp_min,heure_temp_min FROM mois WHERE id='$mois'";
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
while($data = mysql_fetch_assoc($req))
$mois_temp_min=$data['temp_min'];
$mois_date_temp_min=$data['date_temp_min'];
$mois_heure_temp_min=$data['heure_temp_min'];
}
include("meteo/mesures/extremes.php");
include("wswin_extremes.php");
if ($temp_min > $wswin_2008_temp_min) {$temp_min=$wswin_2008_temp_min; $date_temp_min=$wswin_2008_date_temp_min; $heure_temp_min=$wswin_2008_heure_temp_min;}
if ($temp_min > $wswin_2009_temp_min) {$temp_min=$wswin_2009_temp_min; $date_temp_min=$wswin_2009_date_temp_min; $heure_temp_min=$wswin_2009_heure_temp_min;}
if ($temp_min > $wswin_2010_temp_min) {$temp_min=$wswin_2010_temp_min; $date_temp_min=$wswin_2010_date_temp_min; $heure_temp_min=$wswin_2010_heure_temp_min;}
if ($temp_min > $wswin_temp_min) {$temp_min=$wswin_temp_min; $date_temp_min=$wswin_date_temp_min; $heure_temp_min=$wswin_heure_temp_min;}
mysql_query ("UPDATE mois SET
temp_min='$temp_min',date_temp_min='$date_temp_min',heure_temp_min='$heure_temp_min' WHERE id='$jour' ");
if ($mois_temp_min > $wswin_2008_mois_temp_min) {$mois_temp_min=$wswin_2008_mois_temp_min; $mois_date_temp_min=$wswin_2008_mois_date_temp_min; $mois_heure_temp_min=$wswin_2008_mois_heure_temp_min;}
if ($mois_temp_min > $wswin_2009_mois_temp_min) {$mois_temp_min=$wswin_2009_mois_temp_min; $mois_date_temp_min=$wswin_2009_mois_date_temp_min; $mois_heure_temp_min=$wswin_2009_mois_heure_temp_min;}
if ($mois_temp_min > $wswin_2010_mois_temp_min) {$mois_temp_min=$wswin_2010_mois_temp_min; $mois_date_temp_min=$wswin_2010_mois_date_temp_min; $mois_heure_temp_min=$wswin_2010_mois_heure_temp_min;}
if ($mois_temp_min > $temp_min) {$mois_temp_min=$temp_min; $mois_date_temp_min=$date_temp_min; $mois_heure_temp_min=$heure_temp_min;}
mysql_query ("UPDATE mois SET temp_min='$mois_temp_min',date_temp_min='$mois_date_temp_min',heure_temp_min='$mois_heure_temp_min' WHERE id='$mois' ");
mysql_close();
?>