booking details issue
Greetings;
Don't know if anyone is alive here at all, but here goes;
I'm working through this book using Dreamweaver 8, PHP 5 and MySQL 4.1 on Linux.
Everything is going pretty well, except with this problem;
I created my booking_details form and it works. However, I've noticed that the insert isn't working with two rows that use integers in their data.
Specifically roomOptions and networkOptions, PC.
Neither of those two rows are getting input from the applicable form fields, even when checked.
I'm pretty sure I followed the instructions properly (everyone says that I know), but I'm serious. I think the real issue is that I'm not smart enough to figure what the solution is on my own.
Anyway here is what my table looks like in the database;
mysql> describe bookings;
+-------------------+--------------+------+-----+------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+--------------+------+-----+------------+----------------+
| ID | tinyint(11) | | PRI | NULL | auto_increment |
| roomID | tinyint(11) | | | 0 | |
| clientID | tinyint(11) | | | 0 | |
| startDate | date | | | 0000-00-00 | |
| endDate | date | | | 0000-00-00 | |
| adults | int(11) | | | 1 | |
| children | int(11) | | | 0 | |
| roomType | varchar(30) | | | | |
| roomOptions | int(8) | | | 0 | |
| networkConnection | int(8) | | | 0 | |
| PC | int(8) | | | 0 | |
| requirements | varchar(250) | | | | |
+-------------------+--------------+------+-----+------------+----------------+
And here is the relevant part of the form, any help offered, will be extremely appreciated.
<td><div align="right">Is Room Extras Required: </div></td>
<td><div align="left">
<label>
<input <?php if (!(strcmp($row_rsBooking['networkConnection'],1))) {echo "checked=\"checked\"";} ?> name="networkconnection" type="checkbox" id="networkconnection" value="1">
Network Connection
<br>
<input <?php if (!(strcmp($row_rsBooking['PC'],1))) {echo "checked=\"checked\"";} ?> name="PC" type="checkbox" id="PC" value="checkbox">
</label>
PC</div></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td><div align="left"></div></td>
</tr>
<tr>
<td><div align="right">Number of Adults: </div></td>
<td><div align="left"><?php echo $row_rsBooking['adults']; ?></div></td>
</tr>
<tr>
<td><div align="right">Number of Children: </div></td>
<td><div align="left"><?php echo $row_rsBooking['children']; ?></div></td>
</tr>
<tr>
<td><div align="right">Room Optons: </div></td>
<td>
<div align="left">
<p>
<label>
<input <?php if (!(strcmp($row_rsBooking['roomOptions'],"0"))) {echo "checked=\"checked\"";} ?> type="radio" name="roomOptions" value="0">
Smoking</label>
<br>
<label>
<input <?php if (!(strcmp($row_rsBooking['roomOptions'],"1"))) {echo "checked=\"checked\"";} ?> type="radio" name="roomOptions" value="1">
Non-Smoking</label>
<br>
</p>
</div></td>
</tr>
<tr>
<td><div align="right">Special Requirements: </div></td>
<td><div align="left"><?php echo $row_rsBooking['requirements']; ?></div></td>
|