close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

update check box

Thread began 3/29/2014 12:56 am by Joanne | Last modified 4/04/2014 11:27 am by Jason Byrnes | 423 views | 4 replies |

Joanne

update check box

Hi, I am having trouble in updating the checkboxs in dreamweaver. Currently, when I try to insert the data, everything seem like working well for me but when I try to update the data, the checkboxs only an show an empty box. How can I retrieve the data so that whatever i have check previously appears on the checkbox? Can anyone help me? I will really appreciate it. Thank you.

update.php
=========
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
// convert the checkbox group subarray to a string
if (isset($_POST['requirement'])) {
$_POST['requirement'] = implode(',', $_POST['requirement']);
} else {
$_POST['requirement'] = 'none';
}


$updateSQL = sprintf("UPDATE requirement SET event=%s, requirement=%s, facilities=%s, other=%s WHERE matrix=%s",
GetSQLValueString($_POST['event'], "text"),
GetSQLValueString($_POST['requirement'], "text"),
GetSQLValueString($_POST['facilities'], "text"),
GetSQLValueString($_POST['other'], "text"),
GetSQLValueString($_POST['matrix'], "text"));

mysql_select_db($database_localhost, $localhost);
$Result1 = mysql_query($updateSQL, $localhost) or die(mysql_error());
}



<tr valign="baseline">

<td nowrap="nowrap" align="right">Requirement:</td>
<td><input type="checkbox" name="requirement[]" value="Plug" id="requirement_0"<?php echo((in_array("Plug", explode(", ", $row_get_other['requirement'])))?"checked=checked":""); ?>/>
Plug</td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">&nbsp;</td>
<td><input type="checkbox" name="requirement[]" value="Pen" id="requirement_1"<?php echo((in_array("Pen", explode(", ", $row_get_other['requirement'])))?"checked=checked":""); ?>/>
Pen</td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">&nbsp;</td>
<td><input type="checkbox" name="requirement[]" value="Goodies" id="requirement_2"<?php echo((in_array("Goodies", explode(", ", $row_get_other['requirement'])))?"checked=checked":""); ?>/>
Goodies</td>
</tr>

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

Jason ByrnesWebAssist

actually, i think i see the problem.

it looks like the values in your table aren't using a space between the comma, so change:

explode(", ", $row_get_other['requirement'])

to:
explode(",", $row_get_other['requirement'])

Sign in to reply to this post

Joanne

Thank you So MUCH!!!! it work like a charm.... Please keep up the good work....

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it is working.

Sign in to reply to this post

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