PHP veri bir tablo göndererek için önerilen tasarım

0 Cevap php

Merhaba ben bir veritabanı tablosunun sunulması işlemek için nasıl en iyi önerileri arıyorum.

Şimdiye kadar, bu yüzden gibi yinelenen satırlar verileri elde ettik:

<table border=1>
  <tr>
  <th>Phone Number</th>
  <th>Prefix CallerID with</th>
  <th>Seconds to ring before<br/>reaching voicemail</th>
  <th>Voice mailbox<br/>extension number</th>
  <th>Notes</th>

  </tr>
  <?php
      $id = 1;
      foreach ( $line_detail as $line ){
          echo '<tr>';
          echo '<td>'.form::input($id.'_did', $line->did).'</td>';
          echo '<td>'.form::input($id.'_cid_prefix', $line->cid_prefix).'</td>';
          echo '<td>'.form::input(array($id.'_dial_timeput', 'size'=>15, 'maxlength'=>3), $line->dial_timeout).'</td>';
          echo '<td>'.form::dropdown($id.'_extension', $phones, $line->voicemail).'</td>';
          echo '<td>'.form::input($id.'_notes', $line->notes).'</td>';
          echo "</tr>";
          $id++;
      }
  ?>
</table>

Ben bu gönderdiğinizde Ve ben bu gibi veri tekrarı var:

(array) Array
(
    [1_did] => 64123456789
    [1_cid_prefix] => DDI-
    [1_extension] => 800
    [1_notes] => 
    [2_did] => 645678903
    [2_cid_prefix] => TEST-
    [2_extension] => 820
    [2_notes] => 
    [submit] => Save
)

Ok, so now I can group them by id and submit an update to the database. But, I'm wondering if there is a better way of doing this.

0 Cevap