Drop Down multiple select options - hand-modify code for implode
Hi - Here is code block for same set of database table - update form, this time using the Data Assist Server Behaviors. Code block copied re. the update form feature.
so, in your previous post offering a workaround for allowing multiple options within a drop down list, how do we integrate this line:
<?php echo(isset($_POST['elementName'])?implode(", ", $_POST['elementName']):""); ?>
??
Thanks for your help.
-------------
<?php
// WA Application Builder Update
if ($_SERVER["REQUEST_METHOD"] == "POST") // Trigger
{
$WA_connection = $mem1;
$WA_table = "tblPractice1";
$WA_redirectURL = "confirmation.php";
$WA_keepQueryString = false;
$WA_indexField = "practiceID";
$WA_fieldNamesStr = "DIMENS|INTERESTS|languages|ages_served|treatment_techniques|geo_location";
$WA_fieldValuesStr = "".((isset($_POST["DIMENS"]))?$_POST["DIMENS"]:"") ."" . "|" . "".((isset($_POST["INTERESTS"]))?$_POST["INTERESTS"]:"") ."" . "|" . "".((isset($_POST["languages"]))?$_POST["languages"]:"") ."" . "|" . "".((isset($_POST["ages_served"]))?$_POST["ages_served"]:"") ."" . "|" . "".((isset($_POST["treatment_techniques"]))?$_POST["treatment_techniques"]:"") ."" . "|" . "".((isset($_POST["geo_location"]))?$_POST["geo_location"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_comparisonStr = "=|=|=|=|=|=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_where_fieldValuesStr = "".$row_rsPractice['practiceID'] ."";
$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_mem1;
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);
}
}
?>
------------