1 2 3 4 5 6 7 8 9 10 11 12 13
|
<?php
$select = "SELECT * from Produits, Pays, Types WHERE Produits.checked ='VPN' and Pays.code_p = Produits.pays and Types.code_t = Produits.type ORDER BY pays,type,lot,yvert ASC";
$query = mysql_query($select)or die('Erreur SQL !'.$select.'<br>'.mysql_error());
$numlot = 1;
while($row = mysql_fetch_assoc($query))
{
$update = "UPDATE Produits set lot ='".$numlot."' WHERE id_p ='".$row['id_p']."'";
$queryUPDATE = mysql_query($update)or die('Erreur SQL !'.$update.'<br>'.mysql_error());
$numlot = $numlot+1;
}
echo 'Mise à jour des lots effectués';
?> |
Partager