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

Delete record : Not working

Thread began 6/08/2012 8:46 am by MikeH | Last modified 6/08/2012 11:51 am by MikeH | 334 views | 3 replies

MikeH

Delete record : Not working

Hi
I am using the latest build yet the delete record is not doing anything.

3 image files are deleted first and then the record delte is actioned if the trigger delte 3 successful (all 3 files are deleted successfully).

But thats it the delete record does not action. (code below)

Any ideas?

Thanks Mike

php:
<?php require_once('../../Connections/Totalheadturners.php'); ?>
<?php 
require_once("../../webassist/file_manipulation/helperphp.php"); ?>
<?php 
require_once("../../webassist/database_management/wa_appbuilder_php.php"); ?>
<?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;
}
}
$colname_RsImageDetails "-1";
if (isset(
$_GET['imageid'])) {
  
$colname_RsImageDetails $_GET['imageid'];
}
mysql_select_db($database_Totalheadturners$Totalheadturners);
$query_RsImageDetails sprintf("SELECT * FROM CarImages WHERE Id = %s"GetSQLValueString($colname_RsImageDetails"int"));
$RsImageDetails mysql_query($query_RsImageDetails$Totalheadturners) or die(mysql_error());
$row_RsImageDetails mysql_fetch_assoc($RsImageDetails);
$totalRows_RsImageDetails mysql_num_rows($RsImageDetails);?>
<?php 
// WA Application Builder Delete
if ($WA_DeleteFileResult3// Trigger
{
  
$WA_connection $Totalheadturners;
  
$WA_table "CarImages";
  
$WA_redirectURL "../admin_list_images.php?carid=".$row_RsImageDetails['CarLink']  ."";
  if (
function_exists("rel2abs")) $WA_redirectURL $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
  
$WA_keepQueryString false;
  
$WA_fieldNamesStr "Id";
  
$WA_columnTypesStr "none,none,NULL";
  
$WA_fieldValuesStr "".$_GET['imageid']  ."";
  
$WA_comparisonStr "=";
  
$WA_fieldNames explode("|"$WA_fieldNamesStr);
  
$WA_fieldValues explode($WA_AB_Split$WA_fieldValuesStr);
  
$WA_columns explode("|"$WA_columnTypesStr);
  
$WA_comparisions explode("|"$WA_comparisonStr);
  
$WA_connectionDB $database_Totalheadturners;
  
mysql_select_db($WA_connectionDB$WA_connection);
  if (!
session_id()) session_start();
  
$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());
  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
$WA_DeleteFileResult1 
false;
if(
"" == ""){
 
$WA_DeleteFileResult1 WA_FileAssist_DeleteFile("../../uploaded_images/""".$row_RsImageDetails['LargeImage']  ."");
}
?>
<?php
$WA_DeleteFileResult2 
false;
if(
$WA_DeleteFileResult1){
 
$WA_DeleteFileResult2 WA_FileAssist_DeleteFile("../../uploaded_images/medium/""".$row_RsImageDetails['LargeImage']  ."");
}
?>
<?php
$WA_DeleteFileResult3 
false;
if(
$WA_DeleteFileResult2){
 
$WA_DeleteFileResult3 WA_FileAssist_DeleteFile("../../uploaded_images/thumbs/""".$row_RsImageDetails['LargeImage']  ."");
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
I am record: 
<?php echo $_GET['imageid']; ?>
</body>
</html>
<?php
mysql_free_result
($RsImageDetails);
?>

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