unexpected T_ELSE
Posted: Tue Jan 06, 2009 8:33 am
I am getting this error : "Parse error: syntax error, unexpected T_ELSE in /var/www/vhosts/farmworks.com/subdomains/forms/httpdocs/OrderHistory.php on line 54"
this is my code:
<?php
include 'common.php';
?>
<title>Order History</title>
<?
dbConnect();
$result=dbQuery("SELECT * FROM customers c LEFT JOIN orders o ON c.customer_id = o.customer_id WHERE o.customer_id = %1", $_GET['customer_id']);
if($data=dbNext($result))
{
?>
<html style="Background-color:BBBBBB">
<body>
<table>
<tr>
<td>First Name</td>
<td>Last Name</td>
<td style="width:50px"> </td>
<td>Customer</td>
</tr>
<tr>
<td><input type="text" name="First Name" value="<? echo $data['first_name']; ?>"/></td>
<td><input type="text" name="Last Name" value="<? echo $data['last_name']; ?>"/></td>
<td> </td>
<td><input type="text" name="customer_id" value="<? echo $data['customer_id']; ?>"/></td>
</tr>
</table>
<table>
<tr style="height:25px">
<td> </td>
</tr>
<?
$result=dbQuery("SELECT * FROM orders WHERE customer_id=%1",$_GET['customer_id']);
while($row=dbNext($result))
{
echo'<tr>';
echo'<td style="width:50px">'.$row['order_id'].'</td>';
echo'<td style="width:150px">'.$data['ship_date'].'</td>';
echo'<td style="width:50px">'.$row['total_payment'].'</td>';
echo'<td style="width:200px">'.$row['comments'].'</td>';
?>
<td style="width:300px" style="text-align:right"><input type="button" name="Order Details" value="Order Details"></td>
<td><input type="button" name="Delete Record" value="Delete Record"></td>
</tr>
}
</table>
</body>
</html>
<?
}
else
{
?>error!!<?
}
dbClose();
?>
this is my code:
<?php
include 'common.php';
?>
<title>Order History</title>
<?
dbConnect();
$result=dbQuery("SELECT * FROM customers c LEFT JOIN orders o ON c.customer_id = o.customer_id WHERE o.customer_id = %1", $_GET['customer_id']);
if($data=dbNext($result))
{
?>
<html style="Background-color:BBBBBB">
<body>
<table>
<tr>
<td>First Name</td>
<td>Last Name</td>
<td style="width:50px"> </td>
<td>Customer</td>
</tr>
<tr>
<td><input type="text" name="First Name" value="<? echo $data['first_name']; ?>"/></td>
<td><input type="text" name="Last Name" value="<? echo $data['last_name']; ?>"/></td>
<td> </td>
<td><input type="text" name="customer_id" value="<? echo $data['customer_id']; ?>"/></td>
</tr>
</table>
<table>
<tr style="height:25px">
<td> </td>
</tr>
<?
$result=dbQuery("SELECT * FROM orders WHERE customer_id=%1",$_GET['customer_id']);
while($row=dbNext($result))
{
echo'<tr>';
echo'<td style="width:50px">'.$row['order_id'].'</td>';
echo'<td style="width:150px">'.$data['ship_date'].'</td>';
echo'<td style="width:50px">'.$row['total_payment'].'</td>';
echo'<td style="width:200px">'.$row['comments'].'</td>';
?>
<td style="width:300px" style="text-align:right"><input type="button" name="Order Details" value="Order Details"></td>
<td><input type="button" name="Delete Record" value="Delete Record"></td>
</tr>
}
</table>
</body>
</html>
<?
}
else
{
?>error!!<?
}
dbClose();
?>