Well, with that data in place, I ran your last posted query now and it works. I get this as a result:
FINAL | MATERIAL_NAME | UNIT | MATERIAL_TYPE | |
---|---|---|---|---|
1785000 | hashtgiah | gram | consumable | |
13940 | label | gram | packaging | |
591150000 | milk | gram | consumable | |
26775000 | nana | gram | consumable | |
425000 | preform | unit | packaging | |
150000 | priform | unit | packaging | |
26775000 | salt | gram | consumable | |
76500000 | water | gram | consumable |
Now, I see you used some sort of Global’s in your code for $db and $row1. Can you explain these to me?
Is this code because you have more than one function and need to use the data inside a function?
I am unclear why you need to use globals at all.