simple coding help please!
Posted: Tue Apr 19, 2005 7:37 pm
hey for some reason im not getting anything from this... just blank (source from browser= <html><body></body></html>) :/
i was working through this tutorial, but this page didn't come out right. im running through this tutorial http://www.devarticles.com/c/a/MySQL/Bu ... d-MySQL/1/
and im having an enormous amount of trouble.. i have a basic understanding of php and mysql. i have created the database and tables and have inserted the data. as i got to the "products" page which is shown below, i understand most if not all of it, but can't seam to get it to work.. then on the "cart" page which should allow users to add and remove the items from the cart... im totally lost. i can't seam to throw it all together to make a working model
can anyone help ? thanks in advance
Jcart | Please use
i was working through this tutorial, but this page didn't come out right. im running through this tutorial http://www.devarticles.com/c/a/MySQL/Bu ... d-MySQL/1/
and im having an enormous amount of trouble.. i have a basic understanding of php and mysql. i have created the database and tables and have inserted the data. as i got to the "products" page which is shown below, i understand most if not all of it, but can't seam to get it to work.. then on the "cart" page which should allow users to add and remove the items from the cart... im totally lost. i can't seam to throw it all together to make a working model
Code: Select all
<?php
include("db.php");
$cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName);
$result = mysql_query("select * from items order by itemName asc");
?>
<html>
<body>
<table>
<?php
while($row = mysql_fetch_array($result))
{
?>
<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>Code: Select all
tags around your code. Read [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]