php & mysql overzicht generatie
Maar dit wel
Code (php)
1
2
3
2
3
<input type="checkbox" name="betaald[]" value="Rik" />
<input type="checkbox" name="betaald[]" value="Ger" />
<input type="checkbox" name="betaald[]" value="1" checked="checked" />
<input type="checkbox" name="betaald[]" value="Ger" />
<input type="checkbox" name="betaald[]" value="1" checked="checked" />
Als je nu een print_r op $_POST['betaald'] doet krijgj je"
Array [0] => '1'
Daar kan je wat mee:
Code (php)
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
<?php
$sql = "UPDATE
escorts
SET
hasford = 1
WHERE
isescort IN ('" .
implode("','", $betaald) .
"')";
?>
$sql = "UPDATE
escorts
SET
hasford = 1
WHERE
isescort IN ('" .
implode("','", $betaald) .
"')";
?>
Gewijzigd op 07/01/2013 20:24:13 door Ger van Steenderen
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
while($record=mysql_fetch_array($db_query)){
?>
<tr>
<td colspan='2'><center><span style='color:black;'><?php echo $record['volgnummer']; ?></span></center></td></td>
<td colspan='2'><center><span style='color:black;'><?php echo $record['bedrijf']; ?></span></center></td></td>
<td colspan='2'><center><span style='color:black;'><?php echo $record['branche']; ?></span></center></td></td>
<td colspan='2'><center><span style='color:black;'><?php echo $record['teverkopen']; ?></span></center></td></td>
<td colspan='2'><center><span style='color:black;'><?php echo $record['pleknummer']; ?></span></center></td></td>
<?php
if ($record['betaald'] == 1) {
$checked = "checked";
}
else {
$checked = "";
}
?>
<td><input name="betaald[]" type="checkbox" <?php echo $checked; ?>><span style="color:black">Betaalstatus</span></td>
<td><center><a href="edit.php?id=<?php echo $record['volgnummer']; ?>"><img src="../style/edit.png"></a></center></td>
<td><center><a href="delete_ac.php?id=<?php echo $record['volgnummer']; ?>"><img src="../style/delete.png"></a></center></td>
</tr>
while($record=mysql_fetch_array($db_query)){
?>
<tr>
<td colspan='2'><center><span style='color:black;'><?php echo $record['volgnummer']; ?></span></center></td></td>
<td colspan='2'><center><span style='color:black;'><?php echo $record['bedrijf']; ?></span></center></td></td>
<td colspan='2'><center><span style='color:black;'><?php echo $record['branche']; ?></span></center></td></td>
<td colspan='2'><center><span style='color:black;'><?php echo $record['teverkopen']; ?></span></center></td></td>
<td colspan='2'><center><span style='color:black;'><?php echo $record['pleknummer']; ?></span></center></td></td>
<?php
if ($record['betaald'] == 1) {
$checked = "checked";
}
else {
$checked = "";
}
?>
<td><input name="betaald[]" type="checkbox" <?php echo $checked; ?>><span style="color:black">Betaalstatus</span></td>
<td><center><a href="edit.php?id=<?php echo $record['volgnummer']; ?>"><img src="../style/edit.png"></a></center></td>
<td><center><a href="delete_ac.php?id=<?php echo $record['volgnummer']; ?>"><img src="../style/delete.png"></a></center></td>
</tr>