Sorry I must have missed that my post had been moved so have only just found your reply.
I am still confused! I don't understand when you say about having a recordset that filters by the id of the size? Is this by the urlparameter??? and is this on the product details page or the cart page?
My recordset code is as follows:
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_prints = "-1";
if (isset($_GET['ProductID'])) {
$colname_prints = (get_magic_quotes_gpc()) ? $_GET['ProductID'] : addslashes($_GET['ProductID']);
}
mysql_select_db($database_framed, $framed);
$query_prints = sprintf("SELECT * FROM products WHERE ProductID = %s", GetSQLValueString($colname_prints, "int"));
$prints = mysql_query($query_prints, $framed) or die(mysql_error());
$row_prints = mysql_fetch_assoc($prints);
$totalRows_prints = mysql_num_rows($prints);
$paramOptionID_optionsframed = "-1";
if (isset($_GET['ProductID'])) {
$paramOptionID_optionsframed = (get_magic_quotes_gpc()) ? $_GET['ProductID'] : addslashes($_GET['ProductID']);
}
mysql_select_db($database_framed, $framed);
$query_optionsframed = sprintf("SELECT options.* FROM options INNER JOIN productoptions ON options.OptionID = productoptions.OptionID WHERE options.OptionGroupID = 1 AND productoptions.ProductID = %s", GetSQLValueString($paramOptionID_optionsframed, "int"));
$optionsframed = mysql_query($query_optionsframed, $framed) or die(mysql_error());
$row_optionsframed = mysql_fetch_assoc($optionsframed);
$totalRows_optionsframed = mysql_num_rows($optionsframed);
$colname_productoptions = "-1";
if (isset($_GET['ProductID'])) {
$colname_productoptions = (get_magic_quotes_gpc()) ? $_GET['ProductID'] : addslashes($_GET['ProductID']);
}
mysql_select_db($database_framed, $framed);
$query_productoptions = sprintf("SELECT * FROM productoptions WHERE ProductID = %s", GetSQLValueString($colname_productoptions, "int"));
$productoptions = mysql_query($query_productoptions, $framed) or die(mysql_error());
$row_productoptions = mysql_fetch_assoc($productoptions);
$totalRows_productoptions = mysql_num_rows($productoptions);
?>
I don't know if any of the above is correct, especially the bit about joining the tables as this was taken from another forum thread when I was following a different route. I have tried setting the bindings of the add to cart price column to the field I added to the size options table - this field is called PriceIncrements (although now it is the actual price rather than an addition to the base price). I then went into my ecart options and on the calculations I have changed the TotalPrice to read [PriceIncrement] * [Quantity] - I have the same recordsets in my cart page (I think!) see following:
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_photosales = "-1";
if (isset($_GET['ProductID'])) {
$colname_photosales = (get_magic_quotes_gpc()) ? $_GET['ProductID'] : addslashes($_GET['ProductID']);
}
mysql_select_db($database_framed, $framed);
$query_photosales = sprintf("SELECT * FROM products WHERE ProductID = %s", GetSQLValueString($colname_photosales, "int"));
$photosales = mysql_query($query_photosales, $framed) or die(mysql_error());
$row_photosales = mysql_fetch_assoc($photosales);
$totalRows_photosales = mysql_num_rows($photosales);
$colname_productoptions = "-1";
if (isset($_GET['ProductOptionID'])) {
$colname_productoptions = (get_magic_quotes_gpc()) ? $_GET['ProductOptionID'] : addslashes($_GET['ProductOptionID']);
}
mysql_select_db($database_framed, $framed);
$query_productoptions = sprintf("SELECT * FROM productoptions WHERE ProductOptionID = %s", GetSQLValueString($colname_productoptions, "int"));
$productoptions = mysql_query($query_productoptions, $framed) or die(mysql_error());
$row_productoptions = mysql_fetch_assoc($productoptions);
$totalRows_productoptions = mysql_num_rows($productoptions);
?>
<?php
// WA eCart Update
if (isset($_POST["eCart1_Update_100"]) || isset($_POST["eCart1_Update_100_x"])) {
$eCart1->UpdateCart();
$Redirect_redirStr="";
if ($Redirect_redirStr != "") {
$eCart1->redirStr = $Redirect_redirStr;
}
$eCart1->cartAction = "Update";
}
?>
However no price is being taken over to the cart page it is displaying as £0 and also the size is not displaying in the cart? Please help! Getting really lost in this and need a solution quickly.