Hi - I have altered the code to include the implode function at the SELECT menu, using it on the DW insert record behavior. I am now getting this error message:
-------------------
Warning: implode() [function.implode]: Invalid arguments passed in /home/content/77/5308377/html/maint/practice_add.php on line 41
Warning: Cannot modify header information - headers already sent by (output started at /home/content/77/5308377/html/maint/practice_add.php:41) in /home/content/77/5308377/html/maint/practice_add.php on line 55
--------------------
HERE is the PHP code from the header, minus the connection script:
----------------
<?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;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "add_practice")) {
$insertSQL = sprintf("INSERT INTO tblPractice1 (memberID, DIMENS, INTERESTS, languages, ages_served, treatment_techniques, geo_location) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['memberID'], "int"),
GetSQLValueString($_POST['DIMENS'], "text"),
GetSQLValueString(implode(", ", $_POST['INTERESTS']), "text"),
GetSQLValueString($_POST['languages'], "text"),
GetSQLValueString($_POST['ages_served'], "text"),
GetSQLValueString($_POST['treatment_techniques'], "text"),
GetSQLValueString($_POST['geo_location'], "text"));
mysql_select_db($database_mem1, $mem1);
$Result1 = mysql_query($insertSQL, $mem1) or die(mysql_error());
$insertGoTo = "confirmation.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
$colname_rsPractice = "-1";
if (isset($_GET['memberID'])) {
$colname_rsPractice = (get_magic_quotes_gpc()) ? $_GET['memberID'] : addslashes($_GET['memberID']);
}
mysql_select_db($database_mem1, $mem1);
$query_rsPractice = sprintf("SELECT memberID, name_last, name_first FROM tblMembers WHERE memberID = %s", GetSQLValueString($colname_rsPractice, "int"));
$rsPractice = mysql_query($query_rsPractice, $mem1) or die(mysql_error());
$row_rsPractice = mysql_fetch_assoc($rsPractice);
$totalRows_rsPractice = mysql_num_rows($rsPractice);?>
---------------
HERE is the code for the altered field INTERESTS:
---------------
<select name="INTERESTS" size="5" multiple="multiple" id="INTERESTS">
<option value="Addictive Disorders - Alcoholism">Addictive Disorders
- Alcoholism</option>
<option value="Addictive Disorders - Drugs / Substance Abuse">Addictive
Disorders - Drugs / Substance Abuse</option>
<option value="Addictive Disorders - Gambling">Addictive Disorders
- Gambling</option>
</select>
--------------
got the same error message while using the WA behaviors.
Thanks for your help,
Elizabeth