OK, I want to update records if an apartment has been rented or not. First step is displaying the records, right? So (using Dreamweaver) I have this:
<?php
do { ?>
<tr>
<td><?php echo $row_rs_rent['unitnum']; ?></td>
<td><label>
<input <?php if (!(strcmp($row_rs_rent['rent_status'],"1"))) {echo "CHECKED";} ?> type="radio" name="rent_status" value="1">
Rented</label>
<label>
<input <?php if (!(strcmp($row_rs_rent['rent_status'],"0"))) {echo "CHECKED";} ?> type="radio" name="rent_status" value="0">
Vacant</label>
</td>
</tr>
<?php } while ($row_rs_rent = mysql_fetch_assoc($rs_rent)); ?>
This displays the unit numbers and radio buttons for each unit. However, only the button for the last record shows a value, everything else is empty. I tried var_dump($row_rs_rent[‘rent_status’]); and got the following:
string(1) “0”
string(1) “1”
string(1) “1”
string(1) “0”
string(1) “1”
string(1) “1”
string(1) “0”
which tells me the array is properly filled. So why doesn’t it display anything except the last record?