Recordset cannot be updated
Why is it that on PHP pages I cannot use the Behaviour Tools to change a recordset. Whenever I edit a recordset it does not edit the existing code, instead it inserts new code after it. I've seen this in ASP pages as well I think. It has been happening for quite a while, on my old machine and again on my new machine.
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
$param_product = "-1";
if (isset($GET_URL['ID'])) {
$param_product = (get_magic_quotes_gpc()) ? $GET_URL['ID'] : addslashes($GET_URL['ID']);
}
mysql_select_db($database_constring, $constring);
$query_product = sprintf("SELECT * FROM life_prods INNER JOIN prod_pricing ON life_prods.Name = prod_pricing.ProdName WHERE %s = life_prods.ID ORDER BY prod_pricing.Price", GetSQLValueString($param_product, "int"));
$product = mysql_query($query_product, $constring) or die(mysql_error());
$row_product = mysql_fetch_assoc($product);
$totalRows_product = mysql_num_rows($product);$param_product = "-1";
if (isset($_GET["ID"])) {
$param_product = (get_magic_quotes_gpc()) ? $_GET["ID"] : addslashes($_GET["ID"]);
}
mysql_select_db($database_constring, $constring);
$query_product = sprintf("SELECT * FROM life_prods INNER JOIN prod_pricing ON life_prods.Name = prod_pricing.ProdName WHERE %s = life_prods.ID ORDER BY prod_pricing.Price", GetSQLValueString($param_product, "int"));
$product = mysql_query($query_product, $constring) or die(mysql_error());
$row_product = mysql_fetch_assoc($product);
$totalRows_product = mysql_num_rows($product);
?>