Hi all, New to posting on this forum and trying to get my add page to wish list working correctly.
Passing the code and type variables through to this page and echos fine. But when trying to add my database results into an array I am getting the Resource id #4. The code I am using is below without the dasebase password.
--------
Any help with this would be great.
To see the results of this you can look at the page
LINK REMOVED FOR USER SAFETY.
Many thanks and hope this is easy to sort as I have try changing lots of things, but always come out with this error or before an Array error.
Thanks
whiskyman
Passing the code and type variables through to this page and echos fine. But when trying to add my database results into an array I am getting the Resource id #4. The code I am using is below without the dasebase password.
Code:
<?php include 'session.php'; $con = mysql_connect("94.136.61.138", "xxxxx", "xxxx"); setcookie ('basket', $cart); if (isset ($_POST["code"])) $code = mysql_real_escape_string($_POST["code"]); if (isset ($_POST["type"])) $type = mysql_real_escape_string($_POST["type"]); $dbcode = $_POST["code"]; $dbtable = $_POST["type"]; echo "table =" .$dbtable; echo "<br>"; echo "code = ".$dbcode; $query = mysql_db_query("xxxxxxx", "select smalltitle, smallimage, alt_small_img, costprice from $dbtable where pagelocation = '$dbcode'"); echo mysql_error(); while ($row = mysql_fetch_row($query)){ echo $row[0]; for ($z=0; $z<count($code); $z++){ $shoppinglist[] = array(($code[$z][1] /$row[1]) ,$row[0], $row[1], 0); } } for ($i=0; $i<count($shoppinglist); $i++){ addel($shoppinglist[$i][0], $shoppinglist[$i][1], $shoppinglist[$i][2], $shoppinglist[$i][3]); } echo $query; //echo $shoppinglist; //header("location:wish_list.php"); ?>
Any help with this would be great.
To see the results of this you can look at the page
LINK REMOVED FOR USER SAFETY.
Many thanks and hope this is easy to sort as I have try changing lots of things, but always come out with this error or before an Array error.
Thanks
whiskyman
Comment