Wrox Programmer Forums
|
BOOK: Dreamweaver MX: PHP Web Development
This is the forum to discuss the Wrox book Dreamweaver MX: PHP Web Development by Gareth Downes-Powell, Tim Green, Bruno Mairlot; ISBN: 9780764543876
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Dreamweaver MX: PHP Web Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 29th, 2004, 07:47 PM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default change_booking_details.php

Hi I am having a problem with this page. I have taken note of the $ sign to be put in on page 155. At the moment the booking details are showing up but the clients name is not pulling through, this is the third time I have started from scratch and not been able find the problem. Please could some one help me thanks very much in advance. Here is my code below.

<p>Thank you, <?php echo $row_rsclient['firstName']; ?> <?php echo $row_rsclient['lastName']; ?>, you can change
        your booking details below.</p>
      <form action="<?php echo $editFormAction; ?>" method="POST" name="bookroom" id="bookroom">
        <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="239">Arrival Date :</td>
            <td width="261"><input name="startdate" type="text" id="startdate" onFocus="MM_displayStatusMsg('Please enter your arrival date in the yyyy-mm-dd format');return document.MM_returnValue" value="<?php echo $row_rsbooking['startDate']; ?>" maxlength="10">
              (yyyy-mm-dd) </td>
          </tr>
          <tr>
            <td>Departure Date :</td>
            <td><input name="enddate" type="text" id="enddate2" onFocus="MM_displayStatusMsg('Please enter your departure date in the yyyy-mm-dd format.');return document.MM_returnValue" value="<?php echo $row_rsbooking['endDate']; ?>" maxlength="10">
              (yyyy-mm-dd)</td>
          </tr>
          <tr>
            <td>Room Type :</td>
            <td><select name="roomtype" id="roomtype">
                <option value="Single" <?php if (!(strcmp("Single", $row_rsbooking['roomType']))) {echo "SELECTED";} ?>>Single</option>
                <option value="Double" <?php if (!(strcmp("Double", $row_rsbooking['roomType']))) {echo "SELECTED";} ?>>Double</option>
                <option value="Suite" <?php if (!(strcmp("Suite", $row_rsbooking['roomType']))) {echo "SELECTED";} ?>>Suite</option>
              </select></td>
          </tr>
          <tr>
            <td>In Room Extras Required :</td>
            <td> <input <?php if (!(strcmp($row_rsbooking['networkConnection'],1))) {echo "checked";} ?> name="networkconnection" type="checkbox" id="networkconnection" value="1">
              Network Connection</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td> <input <?php if (!(strcmp($row_rsbooking['PC'],1))) {echo "checked";} ?> name="pc" type="checkbox" id="pc" value="1">
              PC</td>
          </tr>
          <tr>
            <td>Number of Adults :</td>
            <td><select name="adults" id="adults">
                <option value="1" <?php if (!(strcmp(1, $row_rsbooking['adults']))) {echo "SELECTED";} ?>>1</option>
                <option value="2" <?php if (!(strcmp(2, $row_rsbooking['adults']))) {echo "SELECTED";} ?>>2</option>
              </select></td>
          </tr>
          <tr>
            <td>Number of Children :</td>
            <td><select name="children" id="children">
                <option value="0" <?php if (!(strcmp(0, $row_rsbooking['children']))) {echo "SELECTED";} ?>>0</option>
                <option value="1" <?php if (!(strcmp(1, $row_rsbooking['children']))) {echo "SELECTED";} ?>>1</option>
                <option value="2" <?php if (!(strcmp(2, $row_rsbooking['children']))) {echo "SELECTED";} ?>>2</option>
                <option value="3" <?php if (!(strcmp(3, $row_rsbooking['children']))) {echo "SELECTED";} ?>>3</option>
              </select></td>
          </tr>
          <tr>
            <td>Room Options :</td>
            <td><table width="413" border="0" align="right" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="227"> <label>
                    <input <?php if (!(strcmp($row_rsbooking['roomOptions'],"0"))) {echo "CHECKED";} ?> type="radio" name="roomoptions" value="0">
                    Smoking </label> </td>
                  <td width="273"> <input <?php if (!(strcmp($row_rsbooking['roomOptions'],"1"))) {echo "CHECKED";} ?> type="radio" name="roomoptions" value="1">
                    Non Smoking</td>
                </tr>
              </table></td>
          </tr>
          <tr>
            <td>Special Requirements :</td>
            <td><textarea name="requirements" cols="30" rows="6" id="textarea"><?php echo $row_rsbooking['requirements']; ?></textarea></td>
          </tr>
          <tr>
            <td> <input name="clientID" type="hidden" id="clientID" value="<?php echo $row_rsbooking['clientID']; ?>">
              <input name="bookingid" type="hidden" id="bookingid" value="<?php echo $row_rsbooking['ID']; ?>">
            </td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td> <input type="submit" name="Submit" value="Change my Booking"></td>
          </tr>
        </table>
        <input type="hidden" name="MM_update" value="bookroom">
      </form>
      <p>&nbsp;</p>
      </td>
  </tr>
  <tr>
    <td colspan="5" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsbooking);

mysql_free_result($rsclient);
?>


 
Old December 29th, 2004, 07:58 PM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not to worry I found the mistake I did not know that the run time value was case sensitive. $row_rsBooking['clientID'] I had ['clientid'] a silly little mistake but one I will always remember. Hopefully this helps someone else






Similar Threads
Thread Thread Starter Forum Replies Last Post
Beg. PHP 5 > Ch. 11 - fetch_field.php crater BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 January 2nd, 2007 12:20 PM
PHP Warning: PHP Startup: Unable to load dynamic l surendran Beginning PHP 1 May 29th, 2006 08:49 AM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM
Error: movie.php & commit.php on p182-186, ch6 willburke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 12th, 2004 02:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.