Page 1 of 1

thankz!!!!

Posted: Fri May 14, 2004 2:07 pm
by enefahchen
is there any wrong with the shopping card coding/?? acn check it out for me??? thankz!!!!

<?php
/*
$count = count($pBuy);
echo "<br>".$count."<br>";

for ($i=0;$i<$count;$i++){
if ($pBuy[$i]>=0){
$db = mysql_connect("localhost", "root");
$select_db = mysql_select_db("enefah", $db);
$db_result = mysql_query($select_db, $db);
$selectUser = "select userID from user where userName = '$username'";
$a_result = mysql_query($selectUser,$db);
$aRecord = mysql_fetch_array($a_result);
echo "('User ID is ".$aRecord["userID"]."')";
echo $pBuy[$i];
$id = $pBuy[$i];
$price = $pPrice[$id];
$quantity = $pQuantity[$id];
settype($quantity,"integer");
settype($price,"double");
$total = $quantity*$price;
$todate = date("Y-m-d");

$sql = "insert into orderlist (SCID ,productID ,userID ,SCDate ,price ,quantity ,SCPrice) ";
$sql.= "values ('NULL','$proID[$id]','$username','$todate','$price','$quantity','$total')";
$result = mysql_query($sql, $db);
echo $sql;
if ($result){
echo "<script>location.href='shopCart.php'</script>";
//echo "<script>alert('You had a new product. Thank you.')</script>";
//echo "<form name=formadminmainpage method=post action='adminmainpage.php'><input type=hidden name=user value=\"user\"></form>";
//echo "<script>document.formadminmainpage.submit()</script>";
}//endif;
}else{
echo"Problem";
}//endif;
}//endfor;
*/

Posted: Fri May 14, 2004 2:10 pm
by markl999
Try the suggestions here first: viewtopic.php?t=17096

After making those changes, report back what errors/output you get.