dies ist mein Code:Wie Codeform wandeln die obige Anordnung zu erhalten
for ($g=1; $g<=$godziny; $g++)
{
echo '<td style="text-align:center; padding: 5px 5px 5px 5px; width:'.(90/$godziny).'%;"><span class="text_19">'.((strlen($g) == 1) ? '0'.$g : $g).'</span></td>';
}
echo '</tr>';
$numrows = 0;
$result = db_query($dba, "select * from ed_frekwencja where id_ucznia='$id_ucznia' and status='ok' order by data_d, id asc");
while ($row = db_fetch_array($result))
{
echo '<input type="hidden" name="frekwencja_id[]" value="'.$row['id'].'">';
$arrf = explode('|', $row['frekwencja']);
echo '<tr class="onclickclass" style="text-align:center;">';
echo '<td style="text-align:center; padding: 5px 5px 5px 5px;"><span class="text_26">'.$row['data_d'].'</span></td>';
for ($i=1; $i<=(empty($godziny) ? 1 : $godziny); $i++)
{
echo '<td>';
echo '<select class="inputsb" name="frekwencja[]" style="width:45px;">';
$kol = array('', 'x', 'y', 'z'); // array danych
foreach($kol as $value)
{
echo '<option value="'.$value.'" '.(($value == $arrf[$i-1]) ? 'selected' : '').'>'.$value.'</option>';
}
echo '</select>';
echo '</td>';
}
echo '</tr>';
$numrows++;
}
echo '</table>';
ich zur Zeit ein solches Zeichen-Array haben:
Array
(
[frekwencja_id] => Array
(
[0] => 1
[1] => 5
[2] => 3
[3] => 4
)
[frekwencja] => Array
(
[0] => x
[1] => y
[2] => z
[3] => x
[4] => y
[5] => z
[6] => x
[7] => y
[8] => z
[9] => x
[10] => y
[11] => z
)
)
und die Notwendigkeit zu erhalten:
Array
(
[frekwencja_id] => Array
(
[0] => 1
[1] => 5
[2] => 3
[3] => 4
)
[frekwencja_1] => Array
(
[0] => x
[1] => y
[2] => z
)
[frekwencja_5] => Array
(
[0] => x
[1] => y
[2] => z
)
[frekwencja_3] => Array
(
[0] => x
[1] => y
[2] => z
)
[frekwencja_4] => Array
(
[0] => x
[1] => y
[2] => z
)
)
was und wo müssen Sie ändern, um die obige Tabelle zu erreichen?
Ihre Frage ist nicht verständlich, bitte aktualisieren Sie sie und fügen Sie weitere Details hinzu, was Sie erreichen werden, sonst ist es schwer, es herauszufinden. – Tomasz