1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| <?php
include ('config.php');
$sql = 'SELECT TOTAL FROM `points_pilotes` WHERE pilotes=\'F. ALONSO\' ';
$result2 = mysql_query($sql, $link) or die($sql . " - " . mysql_error());
$test = mysql_fetch_array($result2);
$test = $test['TOTAL'];
echo '<br>'.'recup de la valeur total : '.$test.'<br>'; // Valeur 20 ici
$test = $test+10;
echo '<br>'.'nouvelle valeur total : '.$test.'<br>'; // Valeur 30 ici
$update = 'UPDATE `points_pilotes` SET `TOTAL` = "$test" WHERE `classement` = 1 ';
$result3 = mysql_query($update, $link) or die($update . " - " . mysql_error());
$new = 'SELECT TOTAL FROM `points_pilotes` WHERE pilotes=\'F. ALONSO\' ';
$result4 = mysql_query($sql, $link) or die($new . " - " . mysql_error());
$test2 = mysql_fetch_array($result4);
$test2 = $test2['TOTAL'];
echo '<br>'.'recup de la new valeur : '.$test2.'<br>'; // Valeur 0 ici
?> |
Partager