1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| $stmt=sqlsrv_query($conn,'SELECT * FROM POINT_ARTICLE where Reference="TEST"');
if( $stmt === false ) {
die( print_r( sqlsrv_errors(), true));
}
while($rows=sqlsrv_fetch_array($stmt))
{
$totalFinal = 0.0;
$stock=sqlsrv_query($conn,'SELECT * FROM POINT_EXPLOITATION where IdReference='.$rows['Id']);
while( $obj = sqlsrv_fetch_array($stock)) {
# print_r ($obj['Id'].", ".$obj['QteStock']."<br />");
$ttc = $obj['QteStock'];
$totalFinal += $ttc; #comptabilise les qté suivant les emplacements dans la vending machine
}
echo $rows['Reference']; echo ": ".$totalFinal." en stock <br>";
} |