close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Saving Multiple Selections

Thread began 11/25/2009 3:18 am by Jaffa | Last modified 11/24/2014 1:07 pm by Jaffa | 5864 views | 23 replies


Implode function causes header errors

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:


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";
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
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>

got the same error message while using the WA behaviors.

Thanks for your help,

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





Ease of use


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