Here is the code for the update page, if you need more please let me know...
<?php require_once('Connections/phptest.php'); ?>
<?php require_once("WA_DataAssist/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;
}
}
?>
<?php
$ParamID_WADAda_user = "-1";
if (isset($_GET['ID'])) {
$ParamID_WADAda_user = (get_magic_quotes_gpc()) ? $_GET['ID'] : addslashes($_GET['ID']);
}
mysql_select_db($database_phptest, $phptest);
$query_WADAda_user = sprintf("SELECT ID, Name, LastName, email FROM da_user WHERE ID = %s", GetSQLValueString($ParamID_WADAda_user, "int"));
$WADAda_user = mysql_query($query_WADAda_user, $phptest) or die(mysql_error());
$row_WADAda_user = mysql_fetch_assoc($WADAda_user);
$totalRows_WADAda_user = mysql_num_rows($WADAda_user);?>
<?php
// WA Application Builder Update
if (isset($_POST["Update_x"])) // Trigger
{
$WA_connection = $phptest;
$WA_table = "da_user";
$WA_redirectURL = "da_user_Detail.php?ID=".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"") ."";
$WA_keepQueryString = false;
$WA_indexField = "ID";
$WA_fieldNamesStr = "Name|LastName|email";
$WA_fieldValuesStr = "".((isset($_POST["Name"]))?$_POST["Name"]:"") ."" . "|" . "".((isset($_POST["LastName"]))?$_POST["LastName"]:"") ."" . "|" . "".((isset($_POST["email"]))?$_POST["email"]:"") ."";
$WA_columnTypesStr = "undefined|undefined|undefined";
$WA_comparisonStr = " = | = | = ";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_where_fieldValuesStr = "".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"") ."";
$WA_where_columnTypesStr = "none,none,NULL";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode("|", $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);
$WA_connectionDB = $database_phptest;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WhereObj = WA_AB_generateWhereClause($WA_where_fieldNames, $WA_where_columns, $WA_where_fieldValues, $WA_where_comparisons );
$WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->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>Update da_user</title>
<link href="WA_DataAssist/styles/Ultramodern_Nautica.css" rel="stylesheet" type="text/css" />
<link href="WA_DataAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="WADAUpdateContainer">
<?php if ($totalRows_WADAda_user > 0) { // Show if recordset not empty ?>
<form action="da_user_Update.php?ID=<?php echo(rawurlencode($row_WADAda_user['ID'])); ?>" method="post" name="WADAUpdateForm" id="WADAUpdateForm">
<div class="WADAHeader">Update Record</div>
<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th class="WADADataTableHeader">ID:</th>
<td class="WADADataTableCell"><?php echo(str_replace('"', '"', $row_WADAda_user['ID'])); ?></td>
</tr>
<tr>
<th class="WADADataTableHeader">Name:</th>
<td class="WADADataTableCell"><input type="text" name="Name" id="Name" value="<?php echo(str_replace('"', '"', $row_WADAda_user['Name'])); ?>" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">LastName:</th>
<td class="WADADataTableCell"><input type="text" name="LastName" id="LastName" value="<?php echo(str_replace('"', '"', $row_WADAda_user['LastName'])); ?>" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">email:</th>
<td class="WADADataTableCell"><input type="text" name="email" id="email" value="<?php echo(str_replace('"', '"', $row_WADAda_user['email'])); ?>" size="32" /></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="Update" id="Update" value="Update" alt="Update" src="WA_DataAssist/images/Nautica/Ultramodern_update.gif" /></td>
<td class="WADADataNavButtonCell" nowrap="nowrap"><a href="da_user_Results.php" title="Cancel"><img border="0" name="Cancel" id="Cancel" alt="Cancel" src="WA_DataAssist/images/Nautica/Ultramodern_cancel.gif" /></a></td>
</tr>
</table>
<input name="WADAUpdateRecordID" type="hidden" id="WADAUpdateRecordID" value="<?php echo(rawurlencode($row_WADAda_user['ID'])); ?>" />
</div>
</form>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_WADAda_user == 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($WADAda_user);
?>