close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

another issue with the automated procedures...

Thread began 2/02/2011 4:46 am by m.finelli420407 | Last modified 2/02/2011 7:19 pm by m.finelli420407 | 1813 views | 5 replies |

m.finelli420407

another issue with the automated procedures...

Hello again.
It seemed I solved a problem when another comes up.
I've preformed the automated creation of the Insert, Update, Detail, Result and Delete pages with the Data Assist wizard.
I've managed to set the upload files where needed with Digital File Pro... but when I type the data into the fields, what I get are not the texts I've inserted but only a "0" for each field (see the image attached).

Consider the following:
I have a MySQL db where there are two tabels: "Album" and "fotografie" (photos in Italian). The "fotografie" table is:

foto_id, int 11, unsigned, not null, autoincrement
caption varchar 100 not null
captioneng varchar 100 not null
foto_big varchar 255 not null
album int 11

I'm testing these pages on my local server managed with MAMP

Can you help me?
Thanks!
Michele

Sign in to reply to this post

m.finelli420407

this solved, but again...

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

Sign in to reply to this post

Jason ByrnesWebAssist

Double click on the Delete record server behavior and make sure a valid data type is selected for the ID column.

Sign in to reply to this post

m.finelli420407

checked...

The Data type of the Id key column (foto_id) is a numeric value, so it is correct.
Any other suggestion?

Thanks
Michele

Sign in to reply to this post

Jason ByrnesWebAssist

you're code does not have an error in it. this code will not generate the error you are getting.

I suspect that the code running on the site is not the same.

Delete the delete page from the remote site and upload it again.

Sign in to reply to this post

m.finelli420407

solved!

Jason,
I went back to the process and re-select the data type to "numeric".
Now everything works perfectly!

Thanks!
Michele

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