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();
?>
unexpected T_ELSE
Moderator: General Moderators
Re: unexpected T_ELSE
Code: Select all
</tr> } </table>
This one has no php tags around it
Re: unexpected T_ELSE
Would I need PHP tags around that?
Re: unexpected T_ELSE
Yes 
As it is, that'}' is just a piece of text that will appear as part of the html source code on the web page.
Put it in php tags
As it is, that'}' is just a piece of text that will appear as part of the html source code on the web page.
Put it in php tags
Code: Select all
<? } ?>