close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Multiple Delete

Thread began 9/27/2010 2:55 pm by Cologne | Last modified 9/27/2010 3:18 pm by Cologne | 933 views | 1 replies

Cologne

Multiple Delete

Hi,

can someone take a look and tell me whats wrong here? It will not delete :-(

<?php session_start(); ?>
<?php require_once('../data/IchBinMusiker.php'); ?>
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if (!WA_Auth_RulePasses("admin")){
WA_Auth_RestrictAccess("../noaccess.php");
}
?>
<?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;
}
}
?>
<?php
mysql_select_db($database_IchBinMusiker, $IchBinMusiker);
$query_unconfirmeduser = "SELECT memberid FROM member WHERE confirmed = 0";
$unconfirmeduser = mysql_query($query_unconfirmeduser, $IchBinMusiker) or die(mysql_error());
$row_unconfirmeduser = mysql_fetch_assoc($unconfirmeduser);
$totalRows_unconfirmeduser = mysql_num_rows($unconfirmeduser);
?>
<?php
mysql_select_db($database_IchBinMusiker, $IchBinMusiker);
$query_confirmeduser = "SELECT memberid FROM member WHERE confirmed = 1";
$confirmeduser = mysql_query($query_confirmeduser, $IchBinMusiker) or die(mysql_error());
$row_confirmeduser = mysql_fetch_assoc($confirmeduser);
$totalRows_confirmeduser = mysql_num_rows($confirmeduser);
?>
<?php
mysql_select_db($database_IchBinMusiker, $IchBinMusiker);
$query_profilesonline = "SELECT profileid FROM profile WHERE publicview = 1";
$profilesonline = mysql_query($query_profilesonline, $IchBinMusiker) or die(mysql_error());
$row_profilesonline = mysql_fetch_assoc($profilesonline);
$totalRows_profilesonline = mysql_num_rows($profilesonline);
?>
<?php
mysql_select_db($database_IchBinMusiker, $IchBinMusiker);
$query_expireduser = "SELECT member.memberid, member.firstname, member.lastname, member.email, member.`timestamp` FROM member WHERE member.confirmed = 0 AND DATE_ADD(member.`timestamp`, INTERVAL 2 HOUR) <= (NOW())";
$expireduser = mysql_query($query_expireduser, $IchBinMusiker) or die(mysql_error());
$row_expireduser = mysql_fetch_assoc($expireduser);
$totalRows_expireduser = mysql_num_rows($expireduser);
?>
<?php
// WA DataAssist Multiple Deletes
if (isset($_POST["button"])) // Trigger
{
if (!session_id()) session_start();
$WA_loopedIDField = array("WADA_RepeatID_memberid");
$WA_loopedField = array("delete");
$WA_connection = $IchBinMusiker;
$WA_table = "member";
$WA_redirectURL = "";
$WA_keepQueryString = false;
$WA_indexField = "memberid";
$WA_columnTypesStr = "none,none,NULL";
$WA_fieldNames = explode("|", $WA_indexField);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_comparisions = array("=");
$WA_connectionDB = $database_IchBinMusiker;
$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);
}
}
?>
<?php
// RepeatSelectionCounter_1 Initialization
$RepeatSelectionCounter_1 = 0;
$RepeatSelectionCounterBasedLooping_1 = false;
$RepeatSelectionCounter_1_Iterations = "1";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Adminbereich</title>
</head>
<body>
<p><a href="../logout.php">Logout!</a></p>
<p>Bestätigte Anmeldungen: <?php echo $totalRows_confirmeduser ?></p>
<p>Unbestätigte Anmeldungen: <?php echo $totalRows_unconfirmeduser ?> </p>
<p>Profile online: <?php echo $totalRows_profilesonline ?></p>
<form id="formExpiredMember" name="formExpiredMember" method="post" action="">
<?php
// RepeatSelectionCounter_1 Begin Loop
$RepeatSelectionCounter_1_IterationsRemaining = $RepeatSelectionCounter_1_Iterations;
while($RepeatSelectionCounter_1_IterationsRemaining--){
if($RepeatSelectionCounterBasedLooping_1 || $row_expireduser){
?>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">Abgelaufenen Datensätz:</td>
</tr>
<?php do { ?>
<tr>
<td width="373"><?php echo $row_expireduser['memberid']; ?><br />
<?php echo $row_expireduser['timestamp']; ?><br />
<?php echo $row_expireduser['firstname']; ?><?php echo $row_expireduser['lastname']; ?><br />
<?php echo $row_expireduser['email']; ?><br /></td>
<td width="20"><input type="hidden" name="WADA_RepeatID_memberid_<?php echo $RepeatSelectionCounter_1; ?>" id="WADA_RepeatID_memberid_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_expireduser["memberid"]; ?>" />
<input type="checkbox" name="delete_<?php echo $RepeatSelectionCounter_1; ?>" id="delete_<?php echo $RepeatSelectionCounter_1; ?>" value='<?php echo $row_expireduser["memberid"]; ?>' /></td>
</tr>
<?php } while ($row_expireduser = mysql_fetch_assoc($expireduser)); ?>
<tr>
<td colspan="2" align="right"><input type="submit" name="button_<?php echo $RepeatSelectionCounter_1; ?>" id="button_<?php echo $RepeatSelectionCounter_1; ?>" value="Löschen" /></td>
</tr>
</table>
<?php
} // RepeatSelectionCounter_1 Begin Alternate Content
else{
?>
<td>Keine abgelaufenen Datensätze vorhanden.</td>
<?php } // RepeatSelectionCounter_1 End Alternate Content
if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
if(!$row_expireduser && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining = 0;}
$row_expireduser = mysql_fetch_assoc($expireduser);
}
$RepeatSelectionCounter_1++;
} // RepeatSelectionCounter_1 End Loop
?>
</form>
</body>
</html>
<?php
mysql_free_result($unconfirmeduser);

mysql_free_result($confirmeduser);

mysql_free_result($profilesonline);

mysql_free_result($expireduser);
?>

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