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


inserting data

Thread began 7/24/2010 6:01 pm by john1r411685 | Last modified 7/26/2010 10:47 am by Jason Byrnes | 571 views | 1 replies |


inserting data


I am trying to pick-up the response when a user ticks a checkbox called – version_id_ac. And or

A user has the option to select either one or both checkboxes in a form and I am trying to store which options they selected in to a mysql table called user_version with a column in the table called version_id

Please see the code below I don’t get anything inserted, please would someone tell me where I am going wrong with my syntax

if ('$data[version_id_ac] == true'); {
$sql_insert = "INSERT into `user_version`
"; }

mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
$user_id = mysql_insert_id($link);

if ('$data[version_id_dc] = true') {
$sql_insert = "INSERT into `user_version`
"; }

Sign in to reply to this post

Jason ByrnesWebAssist

$data[version_id_dc] is not the correct way to refer to a posted form element value.

If the forms method is set to post, the proper code to get the value would be:


For a checkbox, the value that is posted will be the value added to the value attribute:
<input name="checkbox" type="checkbox" id="checkbox" value="my value" />

to check if this checkbox was checked, the code would be:

if(isset($POST['checkbox']) && $POST['checkbox'] != "") {

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





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