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 | 4587 views | 23 replies

elizabeth130596

Insert WA - server side error in WAAB....js file; DW insert+implode pasted here

Hi - Could not access the hand-code-modifed WA implode page since opening it caused WA to 'hang', to not load the insert record dialog box and crashed pgm. SO, I guess we won't be using that page...

DW page with implode fcn added to the INTERESTS field:

----------------

<?php require_once('../Connections/mem1.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;
}
}

$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, geo_location) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['memberID'], "int"),
GetSQLValueString($_POST['DIMENS'], "text"),
GetSQLValueString(implode(", ", $_POST['INTERESTS']), "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 * FROM tblPractice1 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);

$colname_rsMembers = "-1";
if (isset($_GET['memberID'])) {
$colname_rsMembers = (get_magic_quotes_gpc()) ? $_GET['memberID'] : addslashes($_GET['memberID']);
}
mysql_select_db($database_mem1, $mem1);
$query_rsMembers = sprintf("SELECT memberID, name_last, name_first, email FROM tblMembers WHERE memberID = %s", GetSQLValueString($colname_rsMembers, "int"));
$rsMembers = mysql_query($query_rsMembers, $mem1) or die(mysql_error());
$row_rsMembers = mysql_fetch_assoc($rsMembers);
$totalRows_rsMembers = mysql_num_rows($rsMembers);?>

........ PAGE CODE REMOVED EXCEPT FORM .........
<html><body>
<form method="POST" action="<?php echo $editFormAction; ?>" enctype="application/x-www-form-urlencoded" name="add_practice" id="add_practice">
<table width="550" cellpadding="5" cellspacing="0" class="tb_bdr1_gray">
<tr>
<td align="left">&nbsp;</td>
<td>&nbsp;</td>
<td align="right"><p align="right"><span class="style5"><a href="javascript:history.go(-1);">&lt;&lt; Go
Back<br />
</a><a href="member_list.php"><strong>&lt;&lt; Go to List</strong></a></span> </p></td>
</tr>
<tr>
<td width="161" align="left"><strong>Member ID: <?php echo $row_rsMembers['memberID']; ?><br />
&nbsp;
<input name="practiceID" type="hidden" id="practiceID" />
<input name="memberID" type="hidden" value="<?php echo $row_rsMembers['memberID']; ?>" size="32" />
</strong></td>
<td width="20">&nbsp;</td>
<td width="337" align="left"><?php echo $row_rsMembers['name_last']; ?>, <?php echo $row_rsMembers['name_first']; ?><br />
Hold down the CNTL Key and CLICK to
select multiple items from each of these lists. Please the button
below when done.</td>
</tr>
<tr>
<td align="left">Dimensions of Practice:<br />
(Default = Individual)</td>
<td>&nbsp;</td>
<td align="left">
<label>
<select name="DIMENS" size="5" multiple="multiple" id="DIMENS">
<option value="Individual" selected="selected">Individual</option>
<option value="Group">Group</option>
<option value="Family">Family</option>
<option value="Marital/Couples">Marital/Couples</option>
<option value="Emergency/Crisis Intervention">Emergency/Crisis
Intervention</option>
</select>
</label></td>
</tr>
<tr>
<td align="left">Interests:<br />
(Default = Anxiety)</td>
<td>&nbsp;</td>
<td align="left"><!-- USE MISC CODES SOLUTION ???&nbsp;-->
<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>
<option value="Addictive Disorders - Other">Addictive Disorders
- Other</option>
<option value="Anxiety and Panic Disorders" selected="selected">Anxiety and Panic
Disorders</option>
<option value="Phobias">Phobias</option>
<option value="Schizophrenia">Schizophrenia</option>
<option value="Sexual Disorders">Sexual Disorders</option>
<option value="Family - Interpersonal Relationships">Family -
Interpersonal Relationships</option>
<option value="Gender - Bisexual, Gay, Lesbian, Transgender">Gender
- Bisexual, Gay, Lesbian, Transgender, </option>
<option value="Physical - Alzheimer's & Dementia">Physical
- Alzheimer's & Dementia</option>
<option value="Physical - Bereavement & Grief">Physical -
Bereavement & Grief</option>
<option value="Physical - Cancer">Physical - Cancer</option>
<option value="Assessment - Forensics">Assessment - Forensics</option>
<option value="Crime">Crime</option>
</select></td>
</tr>
<tr>
<td align="left">Geographic Locations:<br />
(Default = Metro NYC)</td>
<td>&nbsp;</td>
<td align="left"><select name="geo_location" size="5" multiple="multiple" id="geo_location">
<option value="Brooklyn">Brooklyn</option>
<option value="Metropolitan NYC" selected="selected">Metropolitan NYC</option>
<option value="Mid-Hudson">Mid-Hudson</option>
<option value="Nassau">Nasaau</option>
<option value="Queens">Queens</option>
<option value="Westchester">Westchester</option>
</select></td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
<td>&nbsp;</td>
<td align="left"><label>
<input type="submit" name="Submit" value=" Add Practice Details " />
</label></td>
</tr>
</table>
<!-- end form-->
<input type="hidden" name="MM_insert" value="add_practice" />
</form></body>
</html>
<?php
mysql_free_result($rsPractice);

mysql_free_result($rsMembers);
?>

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

Content

rating

Layout

rating

Ease of use

rating

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