I am relatively new to php and am updating a site for a company. However whenever i try to load the site i recieve this error:
PHP Parse error: syntax error, unexpected '=' in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\neighbours\\include\\left.php on line 67
Here is the code(line 67 highlighted in red):
while($row=$db->fetchArray($rec1))
{
//echo $row['product_name'];
?>
<tr>
<td align="left" class="text-9">
<a href="showoption.php?itid=<?php =$row['prod_id']?>&cat=<?php =$row['cat_id']?>">
<!-- <a href="products.php?mode=prod&prodid=&cat=<?php =$row['prod_id']?>"> --><?php echo $row['product_name'];?></a></td>
<td width="16%" align="center" class="text-9"><img src="images/arrow.jpg" width="7" height="6" /></td>
</tr>
<?php
}
$sql="select * from tbl_product";
$rec1=$db->query($sql);
$total_records=$db->numRows();
if($total_records>=20)
{
?>
could someone tell me why this is?
PHP Parse error: syntax error, unexpected '='
Moderator: General Moderators
Re: PHP Parse error: syntax error, unexpected '='
I believe the space before the equal sign is the problem. Remove the space between <?php and =
-Ben
-Ben
- hawkenterprises
- Forum Commoner
- Posts: 54
- Joined: Thu Feb 28, 2008 9:56 pm
- Location: gresham,oregon
- Contact:
Re: PHP Parse error: syntax error, unexpected '='
does <?php= work I thought only <?= works and that's only if you have short tags enabled.
Re: PHP Parse error: syntax error, unexpected '='
Not sure if it works with short-tags disabled, I can't imagine why it wouldn't, but I know <?php= works with short-tags enabled. At least with PHP5+.
I'm not running a site with short-tags disabled or with PHP4, so I'm unable to verify this.
I like me some short tags though...
Ben
I'm not running a site with short-tags disabled or with PHP4, so I'm unable to verify this.
I like me some short tags though...
Ben
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP Parse error: syntax error, unexpected '='
<?= is a short tag. "<?php echo" is the proper version 