roomID is used to list all record of some room ID, all the record is associated with roomBookingID. When a user clicked "modify", a form is supposed to show. However, a error message shown after I added the red statement.
<?php require_once('../../config/conn.php');
$roomID=$_GET['roomID'];
$sql="SELECT * FROM roomBooking where roomID = '$roomID'";
$room_query_result=mysql_query($sql,$conn);
$row_rs = mysql_fetch_assoc($room_query_result);
$count=mysql_num_rows($room_query_result);
?>
...
<?php
if (isset($_GET['roomID'])) {
$SQL = sprintf("SELECT * FROM roomBooking WHERE roomID = '%s'", $_GET['roomID']);
$rs = mysql_query($SQL, $conn) or die(mysql_error());
$row_rs = mysql_fetch_assoc($rs);
// use heredoc syntax to quote a string and store it in variable $form
$form = <<
房間
日期
(yyyy-mm-dd)
開始時間
(hh-mm-ss)
結束時間
(hh-mm-ss)
使用房間的人數
EOD;
// Substitute a string value into %s found in $form
printf($form,
$row_rs['roomID'],
$row_rs['bookingDate'],
$row_rs['startTime'],
($row_rs['endTime']),
($row_rs['numberOfPeople'])
);
} // end-if
?>
i don't know if it's the same with printf in C and C#, mind me if i'm wrong but %s and %s' is not the same right? , well i guess your error is just parse error .. hope this helps cheers :)