clanstyles Posted June 30, 2007 Share Posted June 30, 2007 <input type="checkbox" name="approved" id="approved" <?php if($f['enabled'] == "1") echo "checked=\"checked\""; ?>" /> it saves it as a boolean in the Db.. how do I set the bool in the DB? Link to comment https://forums.phpfreaks.com/topic/57805-php-and-checkboxes/ Share on other sites More sharing options...
pocobueno1388 Posted June 30, 2007 Share Posted June 30, 2007 You have to set the "type" part of the column to something other than "BOOL". What is it saving as a Boolean? I don't understand. You want it set to something different than a boolean, correct? Link to comment https://forums.phpfreaks.com/topic/57805-php-and-checkboxes/#findComment-286389 Share on other sites More sharing options...
cooldude832 Posted June 30, 2007 Share Posted June 30, 2007 Bool is the same as tinyint meaning you can just say if($f['enabled']) beacuse it returns a bool 0 or 1 (0 is universal false 1 is universal True) Link to comment https://forums.phpfreaks.com/topic/57805-php-and-checkboxes/#findComment-286390 Share on other sites More sharing options...
clanstyles Posted June 30, 2007 Author Share Posted June 30, 2007 Problem is..$values[8] = $_POST['approved']; right? <input type="checkbox" name="approved" id="approved" checked="<?php if($f['enabled']); ?>" /> but when I update updating $values[8] in the db it doesn't update. I have a print out going and it returns blank. but if i check it it saids on. Link to comment https://forums.phpfreaks.com/topic/57805-php-and-checkboxes/#findComment-286413 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.