Answer the question
In order to leave comments, you need to log in
How to write to mysql from input array?
There is an array in the base:
[{"name":"Оплата через Сбербанк Онлайн","description":"<small class=\"form-text text-muted\"><a href=\"\/how-buy\/\" target=\"_blank\">Инструкция<\/a> Как оплатить через сбербанк Онлайн<\/small>"},{"name":"Оплата по счёту","description":"описание"}]
<input type="text" class="form-control" name="payment_methods[][name]" value="">
<textarea class="form-control" name="payment_methods[][description]" rows="5"></textarea>
$shipping_method = array(
array('name' => 'Оплата через Сбербанк Онлайн', 'description' => '<small class="form-text text-muted"><a href="/how-buy/" target="_blank">Инструкция</a> Как оплатить через сбербанк Онлайн</small>')
array('name' => 'Оплата по счёту', 'description' => ''),
);
Answer the question
In order to leave comments, you need to log in
Add indexes to array elements
<input type="text" class="form-control" name="payment_methods[0][name]" value="">
<textarea class="form-control" name="payment_methods[0][description]" rows="5"></textarea>
<input type="text" class="form-control" name="payment_methods[1][name]" value="">
<textarea class="form-control" name="payment_methods[1][description]" rows="5"></textarea>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question