Hello
I've solved the previous issue (changing the field values to text into the wizard view), but now I have a new matter:
When i click on the "delete" button i receive a blank page with this statment: "Unknown column 'undefined4undefined' in 'where clause'".
Here you have the code of the page:
<?php require_once('Connections/foto.php'); ?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.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
$Paramfoto_id_WADAfotografie = "-1";
if (isset($_GET['foto_id'])) {
$Paramfoto_id_WADAfotografie = (get_magic_quotes_gpc()) ? $_GET['foto_id'] : addslashes($_GET['foto_id']);
}
mysql_select_db($database_foto, $foto);
$query_WADAfotografie = sprintf("SELECT foto_id, caption, foto_big FROM fotografie WHERE foto_id = %s", GetSQLValueString($Paramfoto_id_WADAfotografie, "int"));
$WADAfotografie = mysql_query($query_WADAfotografie, $foto) or die(mysql_error());
$row_WADAfotografie = mysql_fetch_assoc($WADAfotografie);
$totalRows_WADAfotografie = mysql_num_rows($WADAfotografie);?>
<?php
// WA Application Builder Delete
if (isset($_POST["Delete_x"])) // Trigger
{
$WA_connection = $foto;
$WA_table = "fotografie";
$WA_redirectURL = "fotografie_Results.php";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_fieldNamesStr = "foto_id";
$WA_columnTypesStr = "none,none,NULL";
$WA_fieldValuesStr = "".((isset($_POST["WADADeleteRecordID"]))?$_POST["WADADeleteRecordID"]:"") ."";
$WA_comparisonStr = "=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_comparisions = explode("|", $WA_comparisonStr);
$WA_connectionDB = $database_foto;
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);
}
}
?>
<!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>Delete fotografie</title>
<link href="WA_DataAssist/styles/Modular_Pacifica.css" rel="stylesheet" type="text/css" />
<link href="WA_DataAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="WADADeleteContainer">
<?php if ($totalRows_WADAfotografie > 0) { // Show if recordset not empty ?>
<form action="fotografie_Delete.php?foto_id=<?php echo(rawurlencode($row_WADAfotografie['foto_id'])); ?>" method="post" name="WADADeleteForm" id="WADADeleteForm">
<div class="WADAHeader">Cancella Fotografia</div>
<p class="WADAMessage">Sei sicuro di voler cancellare questa fotografia?</p>
<p class="WADAMessage"><img src="foto/<?php echo $row_WADAfotografie['foto_big']; ?>" width="200" height="200" /></p>
<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th class="WADADataTableHeader">foto_id:</th>
<td class="WADADataTableCell"><?php echo($row_WADAfotografie['foto_id']); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader">titolo:</th>
<td class="WADADataTableCell"><?php echo($row_WADAfotografie['caption']); ?></td>
</tr>
</table>
<div class="WADAButtonRow">
<table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" name="Delete" id="Delete" value="Delete" alt="Delete" src="WA_DataAssist/images/Pacifica/Modular_delete.gif" /></td>
<td class="WADADataNavButtonCell" nowrap="nowrap"><a href="fotografie_Results.php" title="Cancel"><img border="0" name="Cancel" id="Cancel" alt="Cancel" src="WA_DataAssist/images/Pacifica/Modular_cancel.gif" /></a></td>
</tr>
</table>
<input name="WADADeleteRecordID" type="hidden" id="WADADeleteRecordID" value="<?php echo(rawurlencode($row_WADAfotografie['foto_id'])); ?>" />
</div>
</form>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_WADAfotografie == 0) { // Show if recordset empty ?>
<div class="WADANoResults">
<div class="WADANoResultsMessage">No record found.</div>
</div>
<?php } // Show if recordset empty ?>
</div>
</body>
</html>
<?php
mysql_free_result($WADAfotografie);
?>
Any suggestions?
Thanks
Michele