Jump to content

shopping cart calculate the amount


Louffeman

Recommended Posts

thers' no output:if(isset($_SESSION['cart'])){$sql="SELECT * FROM trybase WHERE name IN (";$sql.=$id.",";foreach($_SESSION['cart'] as $name=>$value) {$sql.="'".$name."',";}the output is http://www.hostingpics.net/viewer.php?id=617578php3.jpgif(isset($_SESSION['paniers'])){$sql="SELECT * FROM trybase WHERE name IN (";$sql.=$id.",";foreach($_SESSION['paniers'] as $name=>$value) {$sql.="'".$name."',";

Link to comment
Share on other sites

now the output is:SELECT * FROM trybase WHERE name IN ('',SELECT * FROM trybase WHERE name IN ('','produits',error the same:Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:wampserver32wwwsalevotre_panier.php on line 31

Link to comment
Share on other sites

for the script:

<?phpif(isset($_SESSION['cart'])){$sql="SELECT * FROM trybase WHERE name IN (";foreach($_SESSION['cart'] as $name=>$value) {$sql.="'".$name."',";}$sql=substr($sql, 0, -1).") ORDER BY name ASC";$query=mysql_query($sql);while ($produit=mysql_fetch_array($query)){?>

the output is:http://www.hostingpics.net/viewer.php?id=203614php5.jpg
Link to comment
Share on other sites

for the script

<?phpif(isset($_SESSION['paniers'])){$sql="SELECT * FROM trybase WHERE name IN (";foreach($_SESSION['paniers'] as $name=>$value) {$sql.="'".$name."',";}$sql=substr($sql, 0, -1).") ORDER BY name ASC";$query=mysql_query($sql);while ($produit=mysql_fetch_array($query)){?>

the output is:http://www.hostingpics.net/viewer.php?id=678861php6.jpgso, I think $_SESSION['paniers']is no good
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...