请我有一个三列的表:
id (this is the id of my table)
parent (this is the parent)
position (and this is the position)
我有这个数组$_arr['menu']
:
array (size=3)
13 =>
array (size=1)
'parent' => string '0' (length=1)
14 =>
array (size=1)
'parent' => string '13' (length=2)
25 =>
array (size=1)
'parent' => string '0' (length=1)
我想用数组$_arr['menu']中的这些值更新 may 表。
我想在一个查询中做类似的事情(也许使用案例):
UPDATE table SET position = 1, parent = 0 WHERE id = 13;
UPDATE table SET position = 2, parent = 13 WHERE id = 14;
UPDATE table SET position = 3, parent = 0 WHERE id = 25;
请大师们,如何从该数组中获取这些值以及如何进行更新!
非常感谢