zaćmienie jakieś chyba miałem wczoraj. mój kod jest następujący.
$stmt = $dbh->prepare( $SELECT_USERS_ADDONS_SETTINGS );
$stmt->execute();
$rowNumber = 1;
echo '<form method="POST" action="update.php" />';
echo '<table id="mytable">'; <th>Lp.</th>
<th>Imię i nazwisko</th>
<th>Akcje</th>
</tr>';
while( $row = $stmt->fetch(PDO::FETCH_ASSOC) )
{
echo '<tr id="id'.$rowNumber.'">';
echo '<td>' . $rowNumber . '</td>'; echo '<td>' . $row['user_name'] . ' ' . $row['user_surname'] . '</td>';
if( $row['user_planVisible'] == 1 )
{
<input type="radio" value="1" name="' . $row['user_id'] . '" checked />
<input type="radio" value="0" name="' . $row['user_id'] . '" />
</td>';
}
else {
<input type="radio" value="1" name="' . $row['user_id'] . '" />
<input type="radio" vlaue="0" name="' . $row['user_id'] . '" checked />
</td>';
}
$rowNumber++;
}
echo '<input class="btnblue" type="submit" value="Zapisz" />';
tak to odbieram w update.php
foreach($_POST as $key=>$value)
{
echo $key . ' ' . $value . '<br />'; }
i zupełnie nie wiem dlaczego wynik jest taki
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 on
15 0
dlaczego dla id 14 wywala mi "on"