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;
*/
thankz!!!!
Moderator: General Moderators
Try the suggestions here first: viewtopic.php?t=17096
After making those changes, report back what errors/output you get.
After making those changes, report back what errors/output you get.