php - Retrieve table column in view -


just started working laravel & i'm trying save both item , quantity. far, have no idea how retrieve item's value table column.

here's code

html

  <table class="table table-condensed table-hover" id="mytable">   <thead>     <tr>       <th>item</th>       <th class="text-center">quantity</th>     </tr>   </thead>   <tbody class="body">     <tr>       <td name="item[]">book</td>       <td>         <select class="form-control" name="qty[]">           <option value="0">0</option>           <option value="1">1</option>           <option value="2">2</option>         </select>       </td>     </tr>     <tr>       <td name="item[]">pencil</td>       <td>         <select class="form-control" name="qty[]">           <option value="0">0</option>           <option value="1">1</option>           <option value="2">2</option>         </select>       </td>     </tr>   </tbody> </table> 

controller

$input = input::all();      ($i = 0; $i < count($input['qty']); $i++) {          $data = array(             'item' => ?????,             'quantity' => $input['qty'][$i]         );          order::create($data);      } 

thanks in advance

td name?? think must put input inside td , if form, after sending can retrieve value $_post or $_get depending of method of form


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -