i'm having lot's of problems with this shopping cart thing, but since i started to talk about this particular function i'll ask for help only with this one now.
in the index.php page i have include("cart.php"); which is a little script like this:
<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#999999">
<tr>
<td bgcolor="#b6b7cb"><b><a href="index.php?page=cart"><font color="#FFFFFF">Cart</font></a></b>
</td>
</tr>
<tr>
<td bgcolor="#F8F8F9">
<?php
include("IEUser.class.php");
$cart = new IEUser();
$cart->seeItems($login_user);
$cart->endIEUser();
?>
</td>
</tr>
</table>
the piece of code in IEUser.class.php that is refered in cart.php is:
function seeItems($login_user) {
$sql = "SELECT * FROM cart WHERE email='$login_user'";
$rs=$this->bd->executeSQL($sql);
$n=0;
while(mysql_fetch_row($rs)) {
echo "".mysql_result($rs, $n, "qte")." - ";
echo "".mysql_result($rs, $n, "cod")."";
echo "<br>";
$n++;
}
}
this works good, but only if you have items in the cart.
if you don't have any items in the cart, the index.php script will break in include("cart.php"); and won't show the rest of the page.
this also happens when you are seeing the product and choosing the quantity you want and click add item, then it goes back to normal.
hope you can help me 'cause i can't move on 'till i figure out this part.
thanks in advance.