Wrox Programmer Forums
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 20th, 2008, 03:08 AM
Registered User
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default parse error

i alsp keep on gettin the same bloody error.the error comes on the last line. html closing tags. can any1 help
heres ther cose:

<?php

// This page will list all of the items
// from the items table. Each item will have
// a link to add it to the cart

include("db.php");

// Get a connection to the database
$cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName);
$result = mysql_query("select * from items order by itemName asc");
?>


<?php
while($row = mysql_fetch_array($result))
{
?>



<tr>
<td width="30%" height="25">

<?php echo $row["itemName"]; ?>

</td>
<td width="10%" height="25">

$<?php echo $row["itemPrice"]; ?>

</td>
<td width="50%" height="25">

<?php echo $row["itemDesc"]; ?>

</td>
<td width="10%" height="25">

<a href="cart.php?action=add_item&id=<?php echo $row["itemId"]; ?>&qty=1">Add Item</a>

</td>
</tr>
<tr>
<td width="100%" colspan="4">

</td>
</tr>
}

<tr>
<td width="100%" colspan="4">

<a href="cart.php">Your Shopping Cart &gt;&gt;</a>

</td>
</tr>
</table>
</body>
</html>
 
Old March 25th, 2008, 11:10 AM
Authorized User
 
Join Date: Sep 2007
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default

Not sure what line number this is...but when you have the following html code you have a php curly brace in there.

Code:
</tr>
}

<tr>
should be

Code:
</tr>
<?php } ?>

<tr>
http://arizonawebdevelopment.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error: syntax error, unexpected T_ELSE in /h vipin k varghese BOOK: XSLT Programmer's Reference, 2nd Edition 4 September 29th, 2011 01:19 AM
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
Parse error: syntax error, unexpected T_STRING ginost7 Beginning PHP 1 November 9th, 2007 02:51 AM
PHP Parse error: parse error, unexpected T_STRING geminient PHP How-To 4 August 18th, 2007 02:27 AM
Parse error: parse error, unexpected $end Ayodeji Adegbaju Pro PHP 3 January 12th, 2007 12:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.