I added a nuDebug($y); to inspect the value of the variable $y. It resolves to UPDATE kode_barang SET stock_item_kode_barang = '334.0000' WHERE kodebarangid = '5cb81f9800d5f09'
Basically it's trying to set stock_item_kode_barang = '334.0000' (decimal value) but stock_item_kode_barang is of type int(11).
kev1n wrote:I added a nuDebug($y); to inspect the value of the variable $y. It resolves to UPDATE kode_barang SET stock_item_kode_barang = '334.0000' WHERE kodebarangid = '5cb81f9800d5f09'
Basically it's trying to set stock_item_kode_barang = '334.0000' (decimal value) but stock_item_kode_barang is of type int(11).
Additionally please verify consistency of other data. When you generate queries you have the following lines generated from your example PIERCHING 3KG.
Please note that lines 3 and 4 are refering twice to the same id but with 2 different values.
ID 5cb8209bb9ad7a0 (line 6) is not existing in the kode_barang table.
1 [0] : UPDATE kode_barang SET stock_item_kode_barang =0.0000 WHERE kode_barang_id ='5cb81dd2dcfc5f7';
2 [0] : UPDATE kode_barang SET stock_item_kode_barang =156.0000 WHERE kode_barang_id ='5cb81f9802c463b';
3 [0] : UPDATE kode_barang SET stock_item_kode_barang =1894.0000 WHERE kode_barang_id ='5cb8193855ff424';
4 [0] : UPDATE kode_barang SET stock_item_kode_barang =3612.0000 WHERE kode_barang_id ='5cb8193855ff424';
5 [0] : UPDATE kode_barang SET stock_item_kode_barang =1062.0000 WHERE kodebarangid ='5cb81dd2db8f2af';
6 [0] : UPDATE kode_barang SET stock_item_kode_barang =128.0000 WHERE kodebarangid ='5cb8209bb9ad7a0';
7 [0] : UPDATE kode_barang SET stock_item_kode_barang =334.0000 WHERE kodebarangid ='5cb81dd2db8f2af';
8 [0] : UPDATE kode_barang SET stock_item_kode_barang =334.0000 WHERE kodebarangid ='5cb81f9800d5f09';
If you like nuBuilder, please leave a review on SourceForge
Janusz wrote:Additionally please verify consistency of other data. When you generate queries you have the following lines generated from your example PIERCHING 3KG.
Please note that lines 3 and 4 are refering twice to the same id but with 2 different values.
ID 5cb8209bb9ad7a0 (line 6) is not existing in the kode_barang table.
1 [0] : UPDATE kode_barang SET stock_item_kode_barang =0.0000 WHERE kode_barang_id ='5cb81dd2dcfc5f7';
2 [0] : UPDATE kode_barang SET stock_item_kode_barang =156.0000 WHERE kode_barang_id ='5cb81f9802c463b';
3 [0] : UPDATE kode_barang SET stock_item_kode_barang =1894.0000 WHERE kode_barang_id ='5cb8193855ff424';
4 [0] : UPDATE kode_barang SET stock_item_kode_barang =3612.0000 WHERE kode_barang_id ='5cb8193855ff424';
5 [0] : UPDATE kode_barang SET stock_item_kode_barang =1062.0000 WHERE kodebarangid ='5cb81dd2db8f2af';
6 [0] : UPDATE kode_barang SET stock_item_kode_barang =128.0000 WHERE kodebarangid ='5cb8209bb9ad7a0';
7 [0] : UPDATE kode_barang SET stock_item_kode_barang =334.0000 WHERE kodebarangid ='5cb81dd2db8f2af';
8 [0] : UPDATE kode_barang SET stock_item_kode_barang =334.0000 WHERE kodebarangid ='5cb81f9800d5f09';
Sir it's a productions Form, that's why it will generate twice or maybe more and it generate according to the production (PRODUKSI) form
Hi, I did following try directly on your application as it was sent and looks that code itself is working proprely. Please verify if you have the same result on your configuration.
>>>>>>>SET all values=33 to the kode_barang from phpMyAdmin (via SQL) (related to Data Produksi > PIERCHING 3KG)
UPDATE kode_barang SET stock_item_kode_barang =33 WHERE kode_barang_id ='5cb81dd2dcfc5f7';
UPDATE kode_barang SET stock_item_kode_barang =33 WHERE kode_barang_id ='5cb81f9802c463b';
UPDATE kode_barang SET stock_item_kode_barang =33 WHERE kode_barang_id ='5cb8193855ff424';
UPDATE kode_barang SET stock_item_kode_barang =33 WHERE kode_barang_id ='5cb8193855ff424';
UPDATE kode_barang SET stock_item_kode_barang =33 WHERE kodebarangid ='5cb81dd2db8f2af';
UPDATE kode_barang SET stock_item_kode_barang =33 WHERE kodebarangid ='5cb8209bb9ad7a0';
UPDATE kode_barang SET stock_item_kode_barang =33 WHERE kodebarangid ='5cb81dd2db8f2af';
UPDATE kode_barang SET stock_item_kode_barang =33 WHERE kodebarangid ='5cb81f9800d5f09';
>>>>>> Check values if updated from phpMyAdmin (all have now value =33)
SELECT stock_item_kode_barang FROM kode_barang WHERE kode_barang_id ='5cb81dd2dcfc5f7';
SELECT stock_item_kode_barang FROM kode_barang WHERE kode_barang_id ='5cb81f9802c463b';
SELECT stock_item_kode_barang FROM kode_barang WHERE kode_barang_id ='5cb8193855ff424';
SELECT stock_item_kode_barang FROM kode_barang WHERE kode_barang_id ='5cb8193855ff424';
SELECT stock_item_kode_barang FROM kode_barang WHERE kodebarangid ='5cb81dd2db8f2af';
SELECT stock_item_kode_barang FROM kode_barang WHERE kodebarangid ='5cb8209bb9ad7a0';
SELECT stock_item_kode_barang FROM kode_barang WHERE kodebarangid ='5cb81dd2db8f2af';
SELECT stock_item_kode_barang FROM kode_barang WHERE kodebarangid ='5cb81f9800d5f09';
==== modify any data from nuBuilder application: Data Produksi > PIERCHING 3KG and SAVE====
>>>>> Check values if updated by phpMyAdmin (all have now values different than 33)
SELECT stock_item_kode_barang FROM kode_barang WHERE kode_barang_id ='5cb81dd2dcfc5f7';
SELECT stock_item_kode_barang FROM kode_barang WHERE kode_barang_id ='5cb81f9802c463b';
SELECT stock_item_kode_barang FROM kode_barang WHERE kode_barang_id ='5cb8193855ff424';
SELECT stock_item_kode_barang FROM kode_barang WHERE kode_barang_id ='5cb8193855ff424';
SELECT stock_item_kode_barang FROM kode_barang WHERE kodebarangid ='5cb81dd2db8f2af';
SELECT stock_item_kode_barang FROM kode_barang WHERE kodebarangid ='5cb8209bb9ad7a0';
SELECT stock_item_kode_barang FROM kode_barang WHERE kodebarangid ='5cb81dd2db8f2af';
SELECT stock_item_kode_barang FROM kode_barang WHERE kodebarangid ='5cb81f9800d5f09';
>>>> so it looks that it behaves properly and changing values from both queries
If you like nuBuilder, please leave a review on SourceForge