|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Parse error: parse error, unexpected $ in
I am working with the shopping cart tutorial at: URL
And when I use the code that is posted in this article and test on my server I get this error: Parse error: parse error, unexpected $ in /www/d/dhenders/htdocs/products.php on line 60 Line 60 is below the last line of code on the page. Her is the code that produces the message: <?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)) { ?> <table> <tr> <td width="30%" height="25"> <font face="verdana" size="1" color="black"> <?php echo $row["itemName"]; ?> </font> </td> <td width="10%" height="25"> <font face="verdana" size="1" color="black"> $<?php echo $row["itemPrice"]; ?> </font> </td> <td width="50%" height="25"> <font face="verdana" size="1" color="black"> <?php echo $row["itemDesc"]; ?> </font> </td> <td width="10%" height="25"> <font face="verdana" size="1" color="black"> <a href="cart.php?action=add_item&id=<?php echo $row["itemId"]; ?>&qty=1">Add Item</a> </font> </td> </tr> <tr> <td width="100%" colspan="4"> <hr size="1" color="red" NOSHADE> </td> </tr> <tr> <td width="100%" colspan="4"> <font face="verdana" size="1" color="black"> <a href="cart.php">Your Shopping Cart >></a> </font> </td> </tr> </table> </body> </html> Any insight as to what could be causing this would be great! Thanks NYColt |
|
#2
|
|||
|
|||
|
i don't see it !!
|
|
#3
|
|||
|
|||
|
Sorry, what do you mean you don't see it?
Do you mean you do not see where an error would occur? |
|
#4
|
|||
|
|||
|
i don't see where you close this braket:
PHP Code:
i think that is the problem ![]() Last edited by stfu : April 24th, 2003 at 12:09 PM. |
|
#5
|
|||
|
|||
|
Can I try just eliminating the open bracket? And if I do I need a ; after while($row = mysql_fetch_array($result))
|
|
#6
|
|||
|
|||
|
you can try this:
PHP Code:
Last edited by stfu : April 24th, 2003 at 12:35 PM. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Parse error: parse error, unexpected $ in |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|