PHP POST batch update

832

I want to _POST below parameters and update in database, how can I separate each batch and update accordingly? All these batch parameters are generate dynamically, so it could be more than 3 and so on.

?id=12

&vstatus1=1
&vname1=size
&vvalues1=M%2CL%2CXL
&vprices1=100%2C300
&vpoints1=11%2C33

&vstatus2=1
&vname2=color
&vvalues2=Black%2CBlue%2CRed%2CWhite
&vprices2=200%2C300%2C622%2C3200
&vpoints2=23%2C32%2C66%2C20

&vstatus3=1
&vname3=type
&vvalues3=Normal%2CDriFit
&vprices3=
&vpoints3=
856

Answer

Solution:

$arr = $_POST; //get post
foreach($arr as $v){
  //do something
}

People are also looking for solutions to the problem: php - Codeigniter model shows Undefined property error on helper

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.