Forum Moderators: coopster
I am having some problems with the Change Booking Details page. It seems to be pulling the Booking information, but not the clients information (name, address, etc). Has anyone else worked with this and if you have did you experience problems? Could creating multiple bookings for the same client been creating the problem?
As I am a PHP newbie I am at a total loss here.
It is calling from two differnt MySQL tables, Bookings and Clients. The information that should be coming from the Clients table to fill the page is what is not working. All the information form the Booking table seems to be coming in fine.
I am able to revieve the information from and send to the Clients talbe on other pages.
<?php
$colname_rsBookings = "1";
if (isset($HTTP_POST_VARS['bookingID'])) {
$colname_rsBookings = (get_magic_quotes_gpc())? $HTTP_POST_VARS['bookingID'] : addslashes($HTTP_POST_VARS['bookingID']);
}
mysql_select_db($database_connTheRabbitHole, $connTheRabbitHole);
$query_rsBookings = sprintf("SELECT * FROM bookings WHERE ID = %s", $colname_rsBookings);
$rsBookings = mysql_query($query_rsBookings, $connTheRabbitHole) or die(mysql_error());
$row_rsBookings = mysql_fetch_assoc($rsBookings);
$totalRows_rsBookings = mysql_num_rows($rsBookings);
mysql_select_db($database_connTheRabbitHole, $connTheRabbitHole);
$query_rsClient = "SELECT * FROM clients WHERE ID = $row_rsBookings['clientID']";
$rsClient = mysql_query($query_rsClient, $connTheRabbitHole) or die(mysql_error());
$row_rsClient = mysql_fetch_assoc($rsClient);
$totalRows_rsClient = mysql_num_rows($rsClient);
?>
echo "<p>",$query_rsClient;
$rsClient = mysql_query($query_rsClient, $connTheRabbitHole) or die(mysql_error());
$row_rsClient = mysql_fetch_assoc($rsClient);
$totalRows_rsClient = mysql_num_rows($rsClient);
echo [php.net] "<p>",$totalRows_rsClient;
This is the response I get:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/virtual/site141/fst/var/www/html/server_side/reservation/bookings/change_booking_details.php on line 14
Line 14 = $query_rsClient = "SELECT * FROM clients WHERE ID = $row_rsBookings['clientID']";
What does the "." do?
<added> strange thing is I am using the WYSIWYG DW MX PHP. I am not hand coding, just following the instructions from the book and trying to understand what is going on. Perhaps I should go back to basics and just start by trying to learn to hand code...
BTW: Did you get that FedEx users guide I sent you yesterday? Was it what you were looking for?
Yeah, I saw that the site was down, what gives. I had noticed a lot of errors in the books, but was starting to think it was just me. I will contact the author.
mincklerstraat
On my way to work I stopped and picked up a copy of O'Rielly's "Creating Dynamic Web Pages: Programming PHP" By Rasmus Lerdorf & Kevin Tatroe. I am going to go back to the drawing board and learn the hand coding. I was hoping to pick it up while doing the tutorials, but I am not picking it up quick enough from the tutorial to understand what is going on exaclty.