I need to build an update query from an associative array from a POST
The POST contains multiple Associative arrays and a couple of key/value pairs
I can sort out which arrays to use but am stuck at building the update query string
array1 (
i => 1 // This is used for each WHERE clause and is the row id
a => 2
b => 3
c => 4
)
array2 (
i => 2
a => 2
b => 3
c => 4
)
I NEED:
“UPDATE table SET a=’2′, b=’3′, c=’4′ WHERE id=’array[i]'”
I have tried all kinds of foreach, while, implode methods pieced together from other posts but none of them deal with this specific problem. Any help would be appreciated. THanks
Try the following: