Thanks, Jason. Here is the code. Another thing I'm using is a javascript date picker, which is formatting the date in another format. This is probably contributing, too?
******************************************************************
<?php require_once('../Connections/jimmy.php'); ?>
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once("../WA_iRite/WARichEditorPHP.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
$ParamID_WADAevents = "-1";
if (isset($_GET['ID'])) {
$ParamID_WADAevents = (get_magic_quotes_gpc()) ? $_GET['ID'] : addslashes($_GET['ID']);
}
mysql_select_db($database_jimmy, $jimmy);
$query_WADAevents = sprintf("SELECT ID, eventName, eventDate, eventInfo FROM events WHERE ID = %s", GetSQLValueString($ParamID_WADAevents, "int"));
$WADAevents = mysql_query($query_WADAevents, $jimmy) or die(mysql_error());
$row_WADAevents = mysql_fetch_assoc($WADAevents);
$totalRows_WADAevents = mysql_num_rows($WADAevents);?>
<?php
// WA Application Builder Update
if (isset($_POST["Update_x"])) // Trigger
{
$WA_connection = $jimmy;
$WA_table = "events";
$WA_redirectURL = "events_Results.php";
$WA_keepQueryString = false;
$WA_indexField = "ID";
$WA_fieldNamesStr = "eventName|eventDate|eventInfo";
$WA_fieldValuesStr = "".((isset($_POST["eventName"]))?$_POST["eventName"]:"") ."" . "|" . "".((isset($_POST["eventDate"]))?$_POST["eventDate"]:"") ."" . "|" . "".((isset($_POST["eventInfo"]))?$_POST["eventInfo"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,NULL|',none,''";
$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_jimmy;
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);
}
}
?>
<?php include("adminHeader.php"); ?>
<link href="../WA_DataAssist/styles/Traditional_Granite Pine.css" rel="stylesheet" type="text/css" />
<link href="../WA_DataAssist/styles/Verdana.css" rel="stylesheet" type="text/css" />
<div class="WADAUpdateContainer">
<?php if ($totalRows_WADAevents > 0) { // Show if recordset not empty ?>
<form action="events_Update.php?ID=<?php echo(rawurlencode($row_WADAevents['ID'])); ?>" method="post" name="WADAUpdateForm" id="WADAUpdateForm">
<div class="WADAHeader">Update Record</div>
<div class="WADAHorizLine"><img src="../WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<table width="600" border="0" cellpadding="0" cellspacing="0" class="WADADataTable">
<tr>
<th valign="top" class="WADADataTableHeader">Event Name/Location:</th>
<td valign="top" class="WADADataTableCell"><input type="text" name="eventName" id="eventName" value="<?php echo(str_replace('"', '"', $row_WADAevents['eventName'])); ?>" size="32" /></td>
</tr>
<tr>
<th valign="top" class="WADADataTableHeader">Event Date:</th>
<td valign="top" class="WADADataTableCell"><input type="text" name="eventDate" id="eventDate" value="<?php echo(str_replace('"', '"', $row_WADAevents['eventDate'])); ?>" size="32" />
<input name="pickDate" type="button" id="pickDate" onclick="KW_doCalendar('eventDate',0)" value="Pick Date" /></td>
</tr>
<tr>
<th valign="top" class="WADADataTableHeader">Event Info:</th>
<td valign="top" class="WADADataTableCell"><?php
// WebAssist iRite: Rich Text Editor for Dreamweaver
$WARichTextEditor_1 = CreateRichTextEditor ("eventInfo", "../WA_iRite/", "100%", "350px", "Basic", "../custom/events_Update_eventInfo1.js", "".$row_WADAevents['eventInfo'] ."");
?></td>
</tr>
</table>
<div class="WADAHorizLine"><img src="../WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<div class="WADAButtonRow">
<table border="0" align="right" cellpadding="0" cellspacing="0" class="WADADataNavButtons">
<tr>
<td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" name="Update" id="Update" value="Update" alt="Update" src="../WA_DataAssist/images/Granite Pine/Traditional_update.gif" /></td>
<td class="WADADataNavButtonCell" nowrap="nowrap"><a href="events_Results.php" title="Cancel"><img border="0" name="Cancel" id="Cancel" alt="Cancel" src="../WA_DataAssist/images/Granite Pine/Traditional_cancel.gif" /></a></td>
</tr>
</table>
<input name="WADAUpdateRecordID" type="hidden" id="WADAUpdateRecordID" value="<?php echo(rawurlencode($row_WADAevents['ID'])); ?>" />
</div>
</form>
<?php } // Show if recordset not empty ?>
<?php if ($totalRows_WADAevents == 0) { // Show if recordset empty ?>
<div class="WADANoResults">
<div class="WADANoResultsMessage">No record found.</div>
</div>
<?php } // Show if recordset empty ?>
</div>
<?php include("adminFooter.php"); ?>
<?php
mysql_free_result($WADAevents);
?>