Sorry, my english is not very good !
Is it faster to put all data from databse to an array and make all changes using that array and at the end you update the database(i.e. you call only 2 times SQL when you retrieve data and when you put the new one on) ?
Or every time you want to make any changes you make them directly on the database (i.e. every time you call SQL)
I hope yo'll understand now

!
10x for your time !