php - Can I fillin an array in a form
Get the solution ↓↓↓I make a order-list of items whereby the stock is below minimum. I make a array of al the items we have, filled with 0. Now I want to enter the number of what must be ordered.
<td><INPUT TYPE="number" NAME="nordering[<php echo $store_central_id ?>]" SIZE="4" maxlength="4"></td>
I see only the last number what must be ordered and even by this not the id_store_central
I look in the database how many items i have, then i make an arrayfor ($i=1;$i<$number;$i++) {$nordering[$i]=0; }
With print_r($nordering) i see only Array ( [0] => 012 ) while there are 317 items in the database.
After filling the array it is like this: Array ( [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 [7] => 0 [8] => 0 [9] => 0 [10] => 0 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 0 [17] => 0 [18] => 0 [19] => 0 [20] => 0 [21] => 0 [22] => 0 [23] => 0 [24] => 0 [25] => 0 [26] => 0 [27] => 0 [28] => 0 [29] => 0 [30] => 0 [31] => 0 [32] => 0 [33] => 0 [34] => 0 [35] => 0 [36] => 0 [37] => 0 [38] => 0 [39] => 0 [40] => 0 [41] => 0 [42] => 0 [43] => 0 [44] => 0 [45] => 0 [46] => 0 [47] => 0 [48] => 0 [49] => 0 etc
So my solution is now to make two arrays, one with the id's and one with the numbers like:<INPUT TYPE="hidden" NAME="norder_items[]" VALUE="<?PHP echo store_central_id ?>">
<td><INPUT TYPE="number" NAME="nordering[]" SIZE="4" maxlength="4"></td>
Answer
Solution:
Seems like you should do it like this:
NAME="<php echo $nordering[$store_central_id]?>"
Just needs more information about your code.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: port 80 in use by "unable to open process" with pid 4!
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.
Similar questions
Find the answer in similar questions on our website.
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.