ASK pengurangan stok di php & mysql. Ane punya tabel barang-idbarang-namabarang-spek-harga-stok dan tabel detail-idbarang-idtrans. Karena pengurangan stok berdasarkan jumlah di table `detail`, sebaiknya agan periksa keberhasilan query yg ini: PHP Code: //menyimpan ke detail. See 20-Year Stock Return Calculator for 20-year returns. See 5, 10 and 20-Year Returns for Widely Held Stocks. Related Calculators. Annual Stock Return Calculator. Annualized Stock Return Calculator. Stock Correlation Calculator. Stock Return Calculator. S&P 500 Return Calculator - Robert Shiller Long-term Stock Data.
Earlier in this tutorial, we have defined arrays that are a single listing of crucial/value sets.
Nevertheless, sometimes you need to shop ideals with more than one key.
This can end up being kept in multidimensional árrays.
PHP - MuItidimensional Arráys
A muItidimensional assortment can be an selection formulated with one or even more arrays.
PHP knows multidimensional arrays that are two, three, fóur, five, or more levels heavy. However, arrays more than three amounts deep are usually hard to take care of for many people.
The dimension of an number indicates the amount of indices you require to select an element.PHP - Twó-dimensional Arráys
A twó-dimensional assortment will be an array of arrays (á three-dimensional assortment is certainly an array of arrays óf árrays).
Initial, get a look at the following desk:
Title | Share | Available |
---|---|---|
VoIvo | 22 | 18 |
BMW | 15 | 13 |
Saab | 5 | 2 |
Land Rovér | 17 | 15 |
![Pengurangan Multi Stok Php Pengurangan Multi Stok Php](http://3.bp.blogspot.com/-dNlThNA9XFQ/Vi7bC38KjeI/AAAAAAAACbk/CvVBruA0G_g/s1600/d.png)
We can store the information from the desk above in á two-dimensional array, like this:
$vehicles = number
(
number('Volvo',22,18),
selection('BMW',15,13),
range('Saab',5,2),
range('Land Rover',17,15)
);
(
number('Volvo',22,18),
selection('BMW',15,13),
range('Saab',5,2),
range('Land Rover',17,15)
);
Right now the two-dimensional $cars array contains four arrays, and it has two indices: line and line.
To obtain accessibility to the elements of the $cars array we must stage to the two indices (row and line):
Instance
It;?php
replicate $cars00.': In share: '.$cars01.', sold: '.$cars02.'.lt;brgt;';
replicate $vehicles10.': In share: '.$cars11.', offered: '.$vehicles12.'.lt;brgt;';
replicate $cars20.': In share: '.$cars21.', offered: '.$cars22.'.lt;brgt;';
replicate $cars30.': In stock: '.$vehicles31.', offered: '.$cars32.'.lt;brgt;';
?gt;
Run example »We can furthermore put areplicate $cars00.': In share: '.$cars01.', sold: '.$cars02.'.lt;brgt;';
replicate $vehicles10.': In share: '.$cars11.', offered: '.$vehicles12.'.lt;brgt;';
replicate $cars20.': In share: '.$cars21.', offered: '.$cars22.'.lt;brgt;';
replicate $cars30.': In stock: '.$vehicles31.', offered: '.$cars32.'.lt;brgt;';
?gt;
for
cycle inside anotherforloop to get the elements of the $vehicles variety (we nevertheless have got to point to the twó indicés):Instance
lt;?php
for ($row = 0; $line lt; 4; $row)
mirror 'lt;pgt;lt;bgt;Row quantity $rowlt;/bgt;It;/pgt;';
echo 'lt;ulgt;';
for ($col = 0; $col lt; 3; $col)
mirror 'lt;ligt;'.$cars$row$col.'It;/Iigt;';
echo 'lt;/ulgt;';
?gt;
Work instance »for ($row = 0; $line lt; 4; $row)
mirror 'lt;pgt;lt;bgt;Row quantity $rowlt;/bgt;It;/pgt;';
echo 'lt;ulgt;';
for ($col = 0; $col lt; 3; $col)
mirror 'lt;ligt;'.$cars$row$col.'It;/Iigt;';
echo 'lt;/ulgt;';
?gt;