Jump to content

[SOLVED] Saving Checkbox Values


Kathy_OC

Recommended Posts

I have a multi-screen form where the user creates a record when they click submit on the first screen and then the record is updated as they complete the following screens.  It works great for the first two screens, but on the third screen I have 3 checkboxes and I haven't been able to update the checkbox values in my database (MySQL).  Each checkbox is a tinyint field in the database and the checkbox value displays correctly when I echo it to the screen.  Also, I'm using adodb in case that matters.

 

What do I need to do to get this to work?

 

Thanks,

Kathy

 

Here's a code snippet:

 

	if ($_POST['chkCIP']) {
		// box was checked
		$CIP = 1;
	} else {
		// box was not checked
		$CIP = 0;
	}
	echo "CIP = " . $CIP . "<br>";

	$result = $db->Execute("UPDATE request SET CIP=? WHERE RequestID=?",array($CIP, $RequestID));

Link to comment
https://forums.phpfreaks.com/topic/108842-solved-saving-checkbox-values/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.