close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

data assist multiple deletes script leaving ?> when re-entered a second time ...

Thread began 3/13/2014 12:19 pm by asarcona308398 | Last modified 3/13/2014 3:52 pm by Jason Byrnes | 423 views | 7 replies |

asarcona308398

data assist multiple deletes script leaving ?> when re-entered a second time ...

Hey guys,

I've noticed a bug when re-entering delete multiple records server behavior
the script will give you this the first time out:

<?php
// WA DataAssist Multiple Deletes
if (isset($_POST["Delete"]) || isset($_POST["Delete_x"])) // Trigger
{
if (!session_id()) session_start();
$WA_loopedIDField = array("WADA_RepeatID_id");
$WA_loopedField = array("WADA_RepeatID_id");
$WA_connection = $conn_studiogear_mgr;
$WA_table = "sg_music_recital";
$WA_redirectURL = "?id=".((isset($_POST["WADADeleteRecordID"]))?$_POST["WADADeleteRecordID"]:"") ."";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_indexField = "recital_id";
$WA_columnTypesStr = "none,none,NULL";
$WA_fieldNames = explode("|", $WA_indexField);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_comparisions = array("=");
$WA_connectionDB = $database_conn_studiogear_mgr;
$WA_multipleDeleteCounter = 0;
mysql_select_db($WA_connectionDB, $WA_connection);
while (WA_AB_checkLoopedFieldsNotBlank($WA_loopedIDField, $WA_multipleDeleteCounter)) {
if (WA_AB_getLoopedFieldValue($WA_loopedIDField[0], $WA_multipleDeleteCounter) == WA_AB_getLoopedFieldValue($WA_loopedField[0], $WA_multipleDeleteCounter)) {
$WA_fieldValuesStr = WA_AB_getLoopedFieldValue($WA_loopedIDField[0], $WA_multipleDeleteCounter);
$WA_fieldValues = array($WA_fieldValuesStr);
$deleteParamsObj = WA_AB_generateWhereClause($WA_fieldNames, $WA_columns, $WA_fieldValues, $WA_comparisions);
$WA_Sql = "DELETE FROM `" . $WA_table . "` WHERE " . $deleteParamsObj->sqlWhereClause;
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
}
$WA_multipleDeleteCounter++;
}
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>


BUT then if re-entering the behavior, this is written to the page:

<?php
// WA DataAssist Multiple Deletes
if (isset($_POST["Delete"]) || isset($_POST["Delete_x"])) // Trigger
{
if (!session_id()) session_start();
$WA_loopedIDField = array("WADA_RepeatID_id");
$WA_loopedField = array("WADA_RepeatID_id");
$WA_connection = $conn_studiogear_mgr;
$WA_table = "sg_music_recital";
$WA_redirectURL = "?id=".((isset($_POST["WADADeleteRecordID"]))?$_POST["WADADeleteRecordID"]:"") ."";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_indexField = "recital_id";
$WA_columnTypesStr = "none,none,NULL";
$WA_fieldNames = explode("|", $WA_indexField);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_comparisions = array("=");
$WA_connectionDB = $database_conn_studiogear_mgr;
$WA_multipleDeleteCounter = 0;
mysql_select_db($WA_connectionDB, $WA_connection);
while (WA_AB_checkLoopedFieldsNotBlank($WA_loopedIDField, $WA_multipleDeleteCounter)) {
if (WA_AB_getLoopedFieldValue($WA_loopedIDField[0], $WA_multipleDeleteCounter) == WA_AB_getLoopedFieldValue($WA_loopedField[0], $WA_multipleDeleteCounter)) {
$WA_fieldValuesStr = WA_AB_getLoopedFieldValue($WA_loopedIDField[0], $WA_multipleDeleteCounter);
$WA_fieldValues = array($WA_fieldValuesStr);
$deleteParamsObj = WA_AB_generateWhereClause($WA_fieldNames, $WA_columns, $WA_fieldValues, $WA_comparisions);
$WA_Sql = "DELETE FROM `" . $WA_table . "` WHERE " . $deleteParamsObj->sqlWhereClause;
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
}
$WA_multipleDeleteCounter++;
}
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
?>
?>
?>
?>
?>

the trailing ?> is extra and will show on the page at the top, if you go in and out many times... the ?> will repeat every time!

Tony

Sign in to reply to this post

Jason ByrnesWebAssist

I am not able to reproduce this using Data Bridge 1.1.8, Dreamweaver CC on Mac OS

please provide some additional details on the Data Bridge version you are using, your DW version, and OS.

Sign in to reply to this post

asarcona308398

Jason,

see attached

Tony

Sign in to reply to this post

Jason ByrnesWebAssist

Im not able to reproduce with Windows 7 and DW CS5 either

Just a note:

some of the extensions you have installed are either outdated or Discontinued

eCart 5.0.3 -> Replaced by 5.0.7
Surveyor -> Discontinued
Bind Search -> The Bing v1 service is no longer available, it was replaced by Bing v2 which is now a paid for service
Theme-It -> this conflicts with Them-It in DE and DB
WebStandards -> Discontinued
Photo Assist -> Discontinued / not compatible with DW CS5


uninstall the discontinued extensions, update eCart, then uninstall and reinstall Data Bridge

Sign in to reply to this post

asarcona308398

Jason,
thanks for the tips, I will do that

Thanks,
Tony

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

asarcona308398

Jason,

Did as said, and except for having to delete cache file, seems to be resolved

Thanks,
Tony

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it is working.

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...