close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Recordset cannot be updated

Thread began 4/08/2010 8:18 am by bjgarner241692 | Last modified 4/14/2010 12:20 pm by Jimmy Wu | 1895 views | 5 replies |

bjgarner241692

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);
?>

Sign in to reply to this post

Jimmy Wu

Did you make any modifications to the recordset by hand before trying to edit using the server behaviors panel?

Recordsets are Dreamweaver functionality, so if you are able to duplicate this functionality regularly, it might be better to contact Adobe Support.

Sign in to reply to this post

bjgarner241692

No, I did not edit it by hand.
I can tell you it only happens on pages with a WA extension on it and it has been an ongoing issue.

Sign in to reply to this post

Jimmy Wu

Could you send me the page so I can test it and see if I get the same issue?

Sign in to reply to this post

neilo

Hi Jimmy,

I am currently getting similar results when I edit a recordset. Even if I just open the recordset from the server behaviors panel and close it without making any changes, the recordset code is duplacated. I have got used to having to go to code view and removing the extra code, but sometimes I forget - and am only reminded of it when I upload the page and get the error message,

"Fatal error: Cannot redeclare getsqlvaluestring() (previously declared in /home/hackers/public_html/ue4/index.php:25) in /home/hackers/public_html/ue4/index.php on line 85"


This has only been happening fairly recently, so I am not sure what the catalyst is. All that I have added is UE4, but - as you say - recordsets are a DW functionality, but I can't see that opening a dialogue with Adobe would help too much as I have not updated DW itself in any way. I'm guessing it's (my) user error I suppose, but I just can't work it out why.

Have made a 2 page DataAssist page-set (results, Delete) to demonstrate.

Sign in to reply to this post

Jimmy Wu

This is very interesting behavior, since I cannot reproduce it. It could be the structure of the database table that is causing the issue. Which columns do you have and what types are they specified as in your db?

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...