Put more than 1 row into mysql from a php array variable in an html form - not working with []? -


The line below is part of a form. When the form is submitted, it enters a line in a mysql table

$ varw will go to different rows. I sometimes have a lot of $ varw in the row given below Just tried to change 'weight' to 'weight []' that 0 (wrong) was entered for $ varw in mysql and it still only adds 1 row.

  print "& lt; input type = 'hidden' name = 'weight' value =". $ Varw "& Gt;";    

You should go! In other words .. a loop.

A heavy comment of the unwanted example below:

  $ i = 0; // Different variable names are required as foreach ($ varw $ $ var) {Print "& lt; input type = \" hidden \ "name = \" ". Weight {$ i}." \ "Value = \" $ Var "\" & Gt; "; $ I ++; // Payroll increment count on every move ...} // Now you will have so many hidden fields like $ varw   

I want you to think about the loop

Manually read,

Happy coding buddy.

PS: Please, the variable names and functional names are capitalized Do not start with.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -