Jump to content

Problems updating database


DanielHardy

Recommended Posts

Hi,

 

I have a code using php and a little bit of java. It (hopefully will eventually) takes the fact that a checkbox has been checked, then updates a variable that changes status( a variable in my database table) to 1 rather than naught. This is all I am trying to achieve at the moment, and then I will add some display conditions afterwards. Basically, it is not working. Please look at my code for me?

 


<?php
// Connects to Database
mysql_connect("localhost", "0607197", "12345") or die(mysql_error());
mysql_select_db("db0607197") or die(mysql_error());

//checks cookies to make sure they are logged in
if(isset($_COOKIE['ID_my_site']))
{
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM Users WHERE username = '$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{

//if the cookie has the wrong password, they are taken to the login page
if ($pass != $info['password'])
{ header("Location: Login.php");
}

//otherwise they are shown the members area
else
{
echo "<p>";
echo "<p>";

}
}
}
else

//if the cookie does not exist, they are taken to the login page
{
header("Location: Login.php");
}

// Displays what user is currently signed in.
?>
<?php
session_start();
?>
<div class="clean22">
<?php
echo " Logged in as  "
?>
</div>
<div class="clean223">
<?php
echo $_COOKIE['ID_my_site'];
?>
</div>
<?php
?>
</div>
<div class="clean223"><a href=logout.php><b>Logout</b></a></div>



<html>
<head>
<title>Regal Theatre - Online Ticket Booking System</title>
<style>
	* {
		font-size: 14px;
		font-family: arial;
	}
</style>
</head>
<body>

<center>
<br/>
<br/>
<br/>
<?php


print_r($_POST);
if (isset($_POST['seats']))
{
	$user = $_COOKIE['ID_my_site'];

	$newStatusCode = $_POST['newStatusCode'];
	$oldStatusCode = $_POST['oldStatusCode'];

	// open database connection
	$linkID = @ mysql_connect("localhost", "0604274", "ah3482") or die("Could not connect to MySQL server");
	@ mysql_select_db("db0604274") or die("Could not select database");

	// prepare select statement
	$selectQuery = "SELECT rowId, columnId, from seats where (";
	$count = 0;
	foreach($_POST['seats'] AS $seat) {
		if ($count > 0) {
			$selectQuery .= " || ";
		}
		$selectQuery .= " ( rowId = '" . substr($seat, 0, 1) . "'";
		$selectQuery .= " and columnId = '" . substr($seat, 1) . "' ) ";
		$count++;
	}
	$selectQuery .= " ) and status = $oldStatusCode";
	if ($oldStatusCode == 1) {
		$selectQuery .= " and updatedby = ''";
	}

	//echo $selectQuery;

	// execute select statement
	$result = mysql_query($selectQuery) or die(mysql_error());
	//echo $result;

	$selectedSeats = mysql_num_rows($result);
	//echo "<br/>" . $selectedSeats;

	if ($selectedSeats != $count) {
		$problem = "<h3>There was a problem executing your request. No seat/s were updated.</h3>";
		$problem .= "Possible problems are:";
		$problem .= "<ul>";
		$problem .= "<li>Another process was able to book the same seat while you were still browsing.</li>";
		$problem .= "<li>You were trying to Confirm an unreserved Seat.</li>";
		$problem .= "<li>You were trying to Cancel an unreserved Seat.</li>";
		$problem .= "<li>You were trying to Reserve a reserved Seat.</li>";
		$problem .= "<li>There was a problem connecting to the database.</li>";
		$problem .= "</ul>";
		$problem .= "<a href='seats.php'>View Seat Plan</a>";
		die ($problem);
	}

	// prepare update statement
	$newStatusCode = $_POST['newStatusCode'];
	$oldStatusCode = $_POST['oldStatusCode'];

	$updateQuery = "UPDATE seats set status=$newStatusCode, updatedby='$user' where ( ";
	$count = 0;
	foreach($_POST['seats'] AS $seat) {
		if ($count > 0) {
			$updateQuery .= " || ";
		}
		$updateQuery .= " ( rowId = '" . substr($seat, 0, 1) . "'";
		$updateQuery .= " and columnId = '" . substr($seat, 1) . "' ) ";
		$count++;
	}
	$updateQuery .= " ) and status = $oldStatusCode";
	if ($oldStatusCode == 1) {
		$updateQuery .= " and updatedby = '$user'";
	}

	// perform update
	$result = mysql_query($updateQuery);
	$updatedSeats = mysql_affected_rows();

	if ($result && $updatedSeats == $count) {
		//$mysql->commit();
		echo "<h3>";
		echo "You have successfully updated $updatedSeats seat/s: ";
		echo "[";
		foreach($_POST['seats'] AS $seat) {
			$rowId = substr($seat, 0, 1);
			$columnId = substr($seat, 1);
			echo $rowId . $columnId . ", ";	
		}
		echo "]";
		echo "...</h3>";
	} else {
		//$mysql->rollback();
		echo "<h3>There was a problem executing your request. No seat/s were updated.</h3>";
		echo "Possible problems are:";
		echo "<ul>";
		echo "<li>Another process was able to book the same seat while you were still browsing.</li>";
		echo "<li>You were trying to Confirm an unreserved Seat.</li>";
		echo "<li>You were trying to Cancel an unreserved Seat.</li>";
		echo "<li>You were trying to Reserve a reserved Seat.</li>";
		echo "<li>There was a problem connecting to the database.</li>";
		echo "</ul>";
	}

	echo "<a href='seats.php'>View Seat Plan</a>";

	// Enable the autocommit feature
	//$mysqldb->autocommit(TRUE);

	// Recuperate the query resources
	//$result->free();

	mysql_close();
}
?>
</center>
</body>
</html>

 

I am getting this error message :

 

Array ( [oldStatusCode] => 1 [newStatusCode] => 2 [seats] => Array ( [0] => ucB8 ) ) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from seats where ( ( rowId = 'u' and columnId = 'cB8' ) ) and s

 

 

the "and s" ( as you will see) is getting the value of a previously entered rowId, However in this example I checked the box uCB8.

 

As you might tell I can getting myself all confused. Any Help you can give me is greatly appreciated.

 

 

Link to comment
https://forums.phpfreaks.com/topic/149157-problems-updating-database/
Share on other sites

Ok that solved the double posting, should of spotted that myself. Thanks

 

Now I have the problem that the program basically does not work as I would like. The database is not updating and the echoed error messages are displayed.

 

Could you please tell me what I am missing?

 

Thanks

 

Don't see nothing relating to a code/form relating to be red.

 

where the code please.

 

quick example

 

<?php

$condition="red";

if($condition=="red"){

$warning="<div style='color: red;'>Hi there your in!</div>";
}else{

$warning="<div style='color: yellow;'>Hi there your not in!</div>";
}
echo $warning;

?>

Here is my form code


<script>

	function confirmSeats() {

		var selectedList = getSelectedList('Confirm Reservation');

		if (selectedList) {
			if (confirm('Do you want to confirm reserved seat/s ' + selectedList + '?')) {
				document.forms[0].oldStatusCode.value=1;
				document.forms[0].newStatusCode.value=2;
				document.forms[0].action='bookseats.php';
				document.forms[0].submit();
			} else {
				clearSelection();
			}
		}
	}


	function getSelectedList(actionSelected) {

		// get selected list
		var obj = document.forms[0].elements;
		var selectedList = '';
		for (var i = 0; i < obj.length; i++) {
			if (obj[i].checked && obj[i].name == 'seats[]') {
				selectedList += obj[i].value + ', ';
			}
		}

		// no selection error
		if (selectedList == '') {
			alert('Please select a seat before clicking ' + actionSelected);
			return false;
		} else {
			return selectedList;
		}

	}

	function clearSelection() {
		var obj = document.forms[0].elements;
		for (var i = 0; i < obj.length; i++) {
			if (obj[i].checked) {
				obj[i].checked = false;
			}
		}
	}


	function refreshView() {
		clearSelection();
		document.forms[0].action='/~0604274/CompSci/tickets/seats.php';
		document.forms[0].submit();
	}

</script>
</head>
<body>
<table>
<tr><td width="100%" align="center">
<form action="/~0604274/CompSci/tickets/seats.php" method="post">

<input type="hidden" name="oldStatusCode" value=""/>
<input type="hidden" name="newStatusCode" value=""/>

<table width='100%' border='0'>
<tr><td align='center'>
	<input type='button' value='Refresh View' onclick='refreshView();'/>

</td></tr>
</table>
</td></tr>
<tr><td width="100%" align="center">
<table width='100%' border='0'>
<tr><td align='left'>
	 <input type='button' value='Confirm Booking' onclick='confirmSeats()'/>
</td></tr>
</table>
</td></tr>
<tr><td width="100%" align="center">
<table width='100%' border='0'>
<tr><td align='right'>

	<input type='button' value='Clear Seat Selection' onclick='clearSelection()'/></td>
</tr>
</table>
</td></tr>
<tr><td width="100%" align="center">
<table width='100%' border='0' cellpadding='1' cellspacing='2'></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>ucF1<input type='checkbox' name='seats[]' value='ucF1'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF2<input type='checkbox' name='seats[]' value='ucF2'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF3<input type='checkbox' name='seats[]' value='ucF3'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF4<input type='checkbox' name='seats[]' value='ucF4'></checkbox></td>

<td bgcolor='lightblue' align='center'>ucF5<input type='checkbox' name='seats[]' value='ucF5'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF6<input type='checkbox' name='seats[]' value='ucF6'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF7<input type='checkbox' name='seats[]' value='ucF7'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF8<input type='checkbox' name='seats[]' value='ucF8'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF9<input type='checkbox' name='seats[]' value='ucF9'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF10<input type='checkbox' name='seats[]' value='ucF10'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF11<input type='checkbox' name='seats[]' value='ucF11'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF12<input type='checkbox' name='seats[]' value='ucF12'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF13<input type='checkbox' name='seats[]' value='ucF13'></checkbox></td>

<td bgcolor='lightblue' align='center'>ucF14<input type='checkbox' name='seats[]' value='ucF14'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucF15<input type='checkbox' name='seats[]' value='ucF15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>ucE1<input type='checkbox' name='seats[]' value='ucE1'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE2<input type='checkbox' name='seats[]' value='ucE2'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE3<input type='checkbox' name='seats[]' value='ucE3'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE4<input type='checkbox' name='seats[]' value='ucE4'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE5<input type='checkbox' name='seats[]' value='ucE5'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE6<input type='checkbox' name='seats[]' value='ucE6'></checkbox></td>

<td bgcolor='lightblue' align='center'>ucE7<input type='checkbox' name='seats[]' value='ucE7'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE8<input type='checkbox' name='seats[]' value='ucE8'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE9<input type='checkbox' name='seats[]' value='ucE9'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE10<input type='checkbox' name='seats[]' value='ucE10'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE11<input type='checkbox' name='seats[]' value='ucE11'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE12<input type='checkbox' name='seats[]' value='ucE12'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE13<input type='checkbox' name='seats[]' value='ucE13'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE14<input type='checkbox' name='seats[]' value='ucE14'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucE15<input type='checkbox' name='seats[]' value='ucE15'></checkbox></td></tr></table></td>

</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>ucD1<input type='checkbox' name='seats[]' value='ucD1'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD2<input type='checkbox' name='seats[]' value='ucD2'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD3<input type='checkbox' name='seats[]' value='ucD3'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD4<input type='checkbox' name='seats[]' value='ucD4'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD5<input type='checkbox' name='seats[]' value='ucD5'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD6<input type='checkbox' name='seats[]' value='ucD6'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD7<input type='checkbox' name='seats[]' value='ucD7'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD8<input type='checkbox' name='seats[]' value='ucD8'></checkbox></td>

<td bgcolor='lightblue' align='center'>ucD9<input type='checkbox' name='seats[]' value='ucD9'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD10<input type='checkbox' name='seats[]' value='ucD10'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD11<input type='checkbox' name='seats[]' value='ucD11'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD12<input type='checkbox' name='seats[]' value='ucD12'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD13<input type='checkbox' name='seats[]' value='ucD13'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD14<input type='checkbox' name='seats[]' value='ucD14'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucD15<input type='checkbox' name='seats[]' value='ucD15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>ucC1<input type='checkbox' name='seats[]' value='ucC1'></checkbox></td>

<td bgcolor='lightblue' align='center'>ucC2<input type='checkbox' name='seats[]' value='ucC2'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC3<input type='checkbox' name='seats[]' value='ucC3'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC4<input type='checkbox' name='seats[]' value='ucC4'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC5<input type='checkbox' name='seats[]' value='ucC5'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC6<input type='checkbox' name='seats[]' value='ucC6'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC7<input type='checkbox' name='seats[]' value='ucC7'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC8<input type='checkbox' name='seats[]' value='ucC8'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC9<input type='checkbox' name='seats[]' value='ucC9'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC10<input type='checkbox' name='seats[]' value='ucC10'></checkbox></td>

<td bgcolor='lightblue' align='center'>ucC11<input type='checkbox' name='seats[]' value='ucC11'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC12<input type='checkbox' name='seats[]' value='ucC12'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC13<input type='checkbox' name='seats[]' value='ucC13'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC14<input type='checkbox' name='seats[]' value='ucC14'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucC15<input type='checkbox' name='seats[]' value='ucC15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>ucB1<input type='checkbox' name='seats[]' value='ucB1'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB2<input type='checkbox' name='seats[]' value='ucB2'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB3<input type='checkbox' name='seats[]' value='ucB3'></checkbox></td>

<td bgcolor='lightblue' align='center'>ucB4<input type='checkbox' name='seats[]' value='ucB4'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB5<input type='checkbox' name='seats[]' value='ucB5'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB6<input type='checkbox' name='seats[]' value='ucB6'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB7<input type='checkbox' name='seats[]' value='ucB7'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB8<input type='checkbox' name='seats[]' value='ucB8'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB9<input type='checkbox' name='seats[]' value='ucB9'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB10<input type='checkbox' name='seats[]' value='ucB10'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB11<input type='checkbox' name='seats[]' value='ucB11'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB12<input type='checkbox' name='seats[]' value='ucB12'></checkbox></td>

<td bgcolor='lightblue' align='center'>ucB13<input type='checkbox' name='seats[]' value='ucB13'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB14<input type='checkbox' name='seats[]' value='ucB14'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucB15<input type='checkbox' name='seats[]' value='ucB15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>ucA1<input type='checkbox' name='seats[]' value='ucA1'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA2<input type='checkbox' name='seats[]' value='ucA2'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA3<input type='checkbox' name='seats[]' value='ucA3'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA4<input type='checkbox' name='seats[]' value='ucA4'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA5<input type='checkbox' name='seats[]' value='ucA5'></checkbox></td>

<td bgcolor='lightblue' align='center'>ucA6<input type='checkbox' name='seats[]' value='ucA6'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA7<input type='checkbox' name='seats[]' value='ucA7'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA8<input type='checkbox' name='seats[]' value='ucA8'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA9<input type='checkbox' name='seats[]' value='ucA9'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA10<input type='checkbox' name='seats[]' value='ucA10'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA11<input type='checkbox' name='seats[]' value='ucA11'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA12<input type='checkbox' name='seats[]' value='ucA12'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA13<input type='checkbox' name='seats[]' value='ucA13'></checkbox></td>
<td bgcolor='lightblue' align='center'>ucA14<input type='checkbox' name='seats[]' value='ucA14'></checkbox></td>

<td bgcolor='lightblue' align='center'>ucA15<input type='checkbox' name='seats[]' value='ucA15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>dcF1<input type='checkbox' name='seats[]' value='dcF1'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF2<input type='checkbox' name='seats[]' value='dcF2'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF3<input type='checkbox' name='seats[]' value='dcF3'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF4<input type='checkbox' name='seats[]' value='dcF4'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF5<input type='checkbox' name='seats[]' value='dcF5'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF6<input type='checkbox' name='seats[]' value='dcF6'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF7<input type='checkbox' name='seats[]' value='dcF7'></checkbox></td>

<td bgcolor='lightblue' align='center'>dcF8<input type='checkbox' name='seats[]' value='dcF8'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF9<input type='checkbox' name='seats[]' value='dcF9'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF10<input type='checkbox' name='seats[]' value='dcF10'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF11<input type='checkbox' name='seats[]' value='dcF11'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF12<input type='checkbox' name='seats[]' value='dcF12'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF13<input type='checkbox' name='seats[]' value='dcF13'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF14<input type='checkbox' name='seats[]' value='dcF14'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcF15<input type='checkbox' name='seats[]' value='dcF15'></checkbox></td></tr></table></td>
</tr>

<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>dcE1<input type='checkbox' name='seats[]' value='dcE1'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE2<input type='checkbox' name='seats[]' value='dcE2'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE3<input type='checkbox' name='seats[]' value='dcE3'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE4<input type='checkbox' name='seats[]' value='dcE4'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE5<input type='checkbox' name='seats[]' value='dcE5'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE6<input type='checkbox' name='seats[]' value='dcE6'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE7<input type='checkbox' name='seats[]' value='dcE7'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE8<input type='checkbox' name='seats[]' value='dcE8'></checkbox></td>

<td bgcolor='lightblue' align='center'>dcE9<input type='checkbox' name='seats[]' value='dcE9'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE10<input type='checkbox' name='seats[]' value='dcE10'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE11<input type='checkbox' name='seats[]' value='dcE11'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE12<input type='checkbox' name='seats[]' value='dcE12'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE13<input type='checkbox' name='seats[]' value='dcE13'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE14<input type='checkbox' name='seats[]' value='dcE14'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcE15<input type='checkbox' name='seats[]' value='dcE15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>dcD1<input type='checkbox' name='seats[]' value='dcD1'></checkbox></td>

<td bgcolor='lightblue' align='center'>dcD2<input type='checkbox' name='seats[]' value='dcD2'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD3<input type='checkbox' name='seats[]' value='dcD3'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD4<input type='checkbox' name='seats[]' value='dcD4'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD5<input type='checkbox' name='seats[]' value='dcD5'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD6<input type='checkbox' name='seats[]' value='dcD6'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD7<input type='checkbox' name='seats[]' value='dcD7'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD8<input type='checkbox' name='seats[]' value='dcD8'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD9<input type='checkbox' name='seats[]' value='dcD9'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD10<input type='checkbox' name='seats[]' value='dcD10'></checkbox></td>

<td bgcolor='lightblue' align='center'>dcD11<input type='checkbox' name='seats[]' value='dcD11'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD12<input type='checkbox' name='seats[]' value='dcD12'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD13<input type='checkbox' name='seats[]' value='dcD13'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD14<input type='checkbox' name='seats[]' value='dcD14'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcD15<input type='checkbox' name='seats[]' value='dcD15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>dcC1<input type='checkbox' name='seats[]' value='dcC1'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC2<input type='checkbox' name='seats[]' value='dcC2'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC3<input type='checkbox' name='seats[]' value='dcC3'></checkbox></td>

<td bgcolor='lightblue' align='center'>dcC4<input type='checkbox' name='seats[]' value='dcC4'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC5<input type='checkbox' name='seats[]' value='dcC5'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC6<input type='checkbox' name='seats[]' value='dcC6'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC7<input type='checkbox' name='seats[]' value='dcC7'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC8<input type='checkbox' name='seats[]' value='dcC8'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC9<input type='checkbox' name='seats[]' value='dcC9'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC10<input type='checkbox' name='seats[]' value='dcC10'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC11<input type='checkbox' name='seats[]' value='dcC11'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC12<input type='checkbox' name='seats[]' value='dcC12'></checkbox></td>

<td bgcolor='lightblue' align='center'>dcC13<input type='checkbox' name='seats[]' value='dcC13'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC14<input type='checkbox' name='seats[]' value='dcC14'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcC15<input type='checkbox' name='seats[]' value='dcC15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>dcB1<input type='checkbox' name='seats[]' value='dcB1'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB2<input type='checkbox' name='seats[]' value='dcB2'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB3<input type='checkbox' name='seats[]' value='dcB3'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB4<input type='checkbox' name='seats[]' value='dcB4'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB5<input type='checkbox' name='seats[]' value='dcB5'></checkbox></td>

<td bgcolor='lightblue' align='center'>dcB6<input type='checkbox' name='seats[]' value='dcB6'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB7<input type='checkbox' name='seats[]' value='dcB7'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB8<input type='checkbox' name='seats[]' value='dcB8'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB9<input type='checkbox' name='seats[]' value='dcB9'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB10<input type='checkbox' name='seats[]' value='dcB10'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB11<input type='checkbox' name='seats[]' value='dcB11'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB12<input type='checkbox' name='seats[]' value='dcB12'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB13<input type='checkbox' name='seats[]' value='dcB13'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcB14<input type='checkbox' name='seats[]' value='dcB14'></checkbox></td>

<td bgcolor='lightblue' align='center'>dcB15<input type='checkbox' name='seats[]' value='dcB15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>dcA1<input type='checkbox' name='seats[]' value='dcA1'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA2<input type='checkbox' name='seats[]' value='dcA2'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA3<input type='checkbox' name='seats[]' value='dcA3'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA4<input type='checkbox' name='seats[]' value='dcA4'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA5<input type='checkbox' name='seats[]' value='dcA5'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA6<input type='checkbox' name='seats[]' value='dcA6'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA7<input type='checkbox' name='seats[]' value='dcA7'></checkbox></td>

<td bgcolor='lightblue' align='center'>dcA8<input type='checkbox' name='seats[]' value='dcA8'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA9<input type='checkbox' name='seats[]' value='dcA9'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA10<input type='checkbox' name='seats[]' value='dcA10'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA11<input type='checkbox' name='seats[]' value='dcA11'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA12<input type='checkbox' name='seats[]' value='dcA12'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA13<input type='checkbox' name='seats[]' value='dcA13'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA14<input type='checkbox' name='seats[]' value='dcA14'></checkbox></td>
<td bgcolor='lightblue' align='center'>dcA15<input type='checkbox' name='seats[]' value='dcA15'></checkbox></td></tr></table></td>
</tr>

<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>BOX1<input type='checkbox' name='seats[]' value='BOX1'></checkbox></td><td> </td>
<td bgcolor='lightblue' align='center'>BOX2<input type='checkbox' name='seats[]' value='BOX2'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>sH1<input type='checkbox' name='seats[]' value='sH1'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH2<input type='checkbox' name='seats[]' value='sH2'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH3<input type='checkbox' name='seats[]' value='sH3'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH4<input type='checkbox' name='seats[]' value='sH4'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH5<input type='checkbox' name='seats[]' value='sH5'></checkbox></td>

<td bgcolor='lightblue' align='center'>sH6<input type='checkbox' name='seats[]' value='sH6'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH7<input type='checkbox' name='seats[]' value='sH7'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH8<input type='checkbox' name='seats[]' value='sH8'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH9<input type='checkbox' name='seats[]' value='sH9'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH10<input type='checkbox' name='seats[]' value='sH10'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH11<input type='checkbox' name='seats[]' value='sH11'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH12<input type='checkbox' name='seats[]' value='sH12'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH13<input type='checkbox' name='seats[]' value='sH13'></checkbox></td>
<td bgcolor='lightblue' align='center'>sH14<input type='checkbox' name='seats[]' value='sH14'></checkbox></td>

<td bgcolor='lightblue' align='center'>sH15<input type='checkbox' name='seats[]' value='sH15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>sG1<input type='checkbox' name='seats[]' value='sG1'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG2<input type='checkbox' name='seats[]' value='sG2'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG3<input type='checkbox' name='seats[]' value='sG3'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG4<input type='checkbox' name='seats[]' value='sG4'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG5<input type='checkbox' name='seats[]' value='sG5'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG6<input type='checkbox' name='seats[]' value='sG6'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG7<input type='checkbox' name='seats[]' value='sG7'></checkbox></td>

<td bgcolor='lightblue' align='center'>sG8<input type='checkbox' name='seats[]' value='sG8'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG9<input type='checkbox' name='seats[]' value='sG9'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG10<input type='checkbox' name='seats[]' value='sG10'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG11<input type='checkbox' name='seats[]' value='sG11'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG12<input type='checkbox' name='seats[]' value='sG12'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG13<input type='checkbox' name='seats[]' value='sG13'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG14<input type='checkbox' name='seats[]' value='sG14'></checkbox></td>
<td bgcolor='lightblue' align='center'>sG15<input type='checkbox' name='seats[]' value='sG15'></checkbox></td></tr></table></td>
</tr>

<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>sF1<input type='checkbox' name='seats[]' value='sF1'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF2<input type='checkbox' name='seats[]' value='sF2'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF3<input type='checkbox' name='seats[]' value='sF3'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF4<input type='checkbox' name='seats[]' value='sF4'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF5<input type='checkbox' name='seats[]' value='sF5'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF6<input type='checkbox' name='seats[]' value='sF6'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF7<input type='checkbox' name='seats[]' value='sF7'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF8<input type='checkbox' name='seats[]' value='sF8'></checkbox></td>

<td bgcolor='lightblue' align='center'>sF9<input type='checkbox' name='seats[]' value='sF9'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF10<input type='checkbox' name='seats[]' value='sF10'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF11<input type='checkbox' name='seats[]' value='sF11'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF12<input type='checkbox' name='seats[]' value='sF12'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF13<input type='checkbox' name='seats[]' value='sF13'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF14<input type='checkbox' name='seats[]' value='sF14'></checkbox></td>
<td bgcolor='lightblue' align='center'>sF15<input type='checkbox' name='seats[]' value='sF15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>sE1<input type='checkbox' name='seats[]' value='sE1'></checkbox></td>

<td bgcolor='lightblue' align='center'>sE2<input type='checkbox' name='seats[]' value='sE2'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE3<input type='checkbox' name='seats[]' value='sE3'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE4<input type='checkbox' name='seats[]' value='sE4'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE5<input type='checkbox' name='seats[]' value='sE5'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE6<input type='checkbox' name='seats[]' value='sE6'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE7<input type='checkbox' name='seats[]' value='sE7'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE8<input type='checkbox' name='seats[]' value='sE8'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE9<input type='checkbox' name='seats[]' value='sE9'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE10<input type='checkbox' name='seats[]' value='sE10'></checkbox></td>

<td bgcolor='lightblue' align='center'>sE11<input type='checkbox' name='seats[]' value='sE11'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE12<input type='checkbox' name='seats[]' value='sE12'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE13<input type='checkbox' name='seats[]' value='sE13'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE14<input type='checkbox' name='seats[]' value='sE14'></checkbox></td>
<td bgcolor='lightblue' align='center'>sE15<input type='checkbox' name='seats[]' value='sE15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>sD1<input type='checkbox' name='seats[]' value='sD1'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD2<input type='checkbox' name='seats[]' value='sD2'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD3<input type='checkbox' name='seats[]' value='sD3'></checkbox></td>

<td bgcolor='lightblue' align='center'>sD4<input type='checkbox' name='seats[]' value='sD4'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD5<input type='checkbox' name='seats[]' value='sD5'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD6<input type='checkbox' name='seats[]' value='sD6'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD7<input type='checkbox' name='seats[]' value='sD7'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD8<input type='checkbox' name='seats[]' value='sD8'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD9<input type='checkbox' name='seats[]' value='sD9'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD10<input type='checkbox' name='seats[]' value='sD10'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD11<input type='checkbox' name='seats[]' value='sD11'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD12<input type='checkbox' name='seats[]' value='sD12'></checkbox></td>

<td bgcolor='lightblue' align='center'>sD13<input type='checkbox' name='seats[]' value='sD13'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD14<input type='checkbox' name='seats[]' value='sD14'></checkbox></td>
<td bgcolor='lightblue' align='center'>sD15<input type='checkbox' name='seats[]' value='sD15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>sC1<input type='checkbox' name='seats[]' value='sC1'></checkbox></td>
<td bgcolor='lightblue' align='center'>sC2<input type='checkbox' name='seats[]' value='sC2'></checkbox></td>
<td bgcolor='lightblue' align='center'>sC3<input type='checkbox' name='seats[]' value='sC3'></checkbox></td>
<td bgcolor='lightblue' align='center'>sC4<input type='checkbox' name='seats[]' value='sC4'></checkbox></td>
<td bgcolor='lightblue' align='center'>sC5<input type='checkbox' name='seats[]' value='sC5'></checkbox></td>


<td bgcolor='lightblue' align='center'>sC15<input type='checkbox' name='seats[]' value='sC15'></checkbox></td></tr></table></td>
</tr>
<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>sB1<input type='checkbox' name='seats[]' value='sB1'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB2<input type='checkbox' name='seats[]' value='sB2'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB3<input type='checkbox' name='seats[]' value='sB3'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB4<input type='checkbox' name='seats[]' value='sB4'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB5<input type='checkbox' name='seats[]' value='sB5'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB6<input type='checkbox' name='seats[]' value='sB6'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB7<input type='checkbox' name='seats[]' value='sB7'></checkbox></td>

<td bgcolor='lightblue' align='center'>sB8<input type='checkbox' name='seats[]' value='sB8'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB9<input type='checkbox' name='seats[]' value='sB9'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB10<input type='checkbox' name='seats[]' value='sB10'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB11<input type='checkbox' name='seats[]' value='sB11'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB12<input type='checkbox' name='seats[]' value='sB12'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB13<input type='checkbox' name='seats[]' value='sB13'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB14<input type='checkbox' name='seats[]' value='sB14'></checkbox></td>
<td bgcolor='lightblue' align='center'>sB15<input type='checkbox' name='seats[]' value='sB15'></checkbox></td></tr></table></td>
</tr>

<tr><td align='center'><table border='1' cellpadding='2' cellspacing='2'><tr>
<td bgcolor='lightblue' align='center'>sA1<input type='checkbox' name='seats[]' value='sA1'></checkbox></td>
<td bgcolor='lightblue' align='center'>sA2<input type='checkbox' name='seats[]' value='sA2'></checkbox></td>
<td bgcolor='lightblue' align='center'>sA3<input type='checkbox' name='seats[]' value='sA3'></checkbox></td>
<td bgcolor='lightblue' align='center'>sA4<input type='checkbox' name='seats[]' value='sA4'></checkbox></td>
<td bgcolor='lightblue' align='center'>sA5<input type='checkbox' name='seats[]' value='sA5'></checkbox></td>
<td bgcolor='lightblue' align='center'>sA6<input type='checkbox' name='seats[]' value='sA6'></checkbox></td>
<td bgcolor='lightblue' align='center'>sA7<input type='checkbox' name='seats[]' value='sA7'></checkbox></td>
<td bgcolor='lightblue' align='center'>sA8<input type='checkbox' name='seats[]' value='sA8'></checkbox></td>

<td bgcolor='lightblue' align='center'>sA9<input type='checkbox' name='seats[]' value='sA9'></checkbox></td>
<td bgcolor='lightblue' align='center'>sA10<input type='checkbox' name='seats[]' value='sA10'></checkbox></td>
<td bgcolor='lightblue'>Available</td>
		<td bgcolor='FF0000'>Seat Booked</td>
	</tr>
</table>
</td></tr>
<tr><td> </td></tr>
<tr><td width="100%" align="center">
  <a href="seatplan.jpg" target="new">View Layout</a> 

</td></tr>
</table>
</form>
</body>
</html>

The default value is now set to 1.

 

when i run it it still gives the error codes and shows this ( as I am echoing a query):

 

Array ( [oldStatusCode] => 1 [newStatusCode] => 2 [seats] => Array ( [0] => sA14 ) )

 

its saying it has updated it, but it hasnt?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.