blade_922 Posted September 14, 2006 Share Posted September 14, 2006 [code]<td> <input type="checkbox" name="mainhot" value="" <?php echo $row->mainhot ? 'checked="checked"' : ''; ?> /></td>[/code]K so thats the code above. What im doing is creating a check box. So if the checkbox is checked then value in database will change to '1' if its then unchecked it will change to '0'Ok so with this code i manage to change the value in the database to 1 for the first time. Then when i try to uncheck it and click save on my page it ends up staying checked and the value doesnt go back to 0.I dont have a clue why its doing this. Hope you can assist.Regards Quote Link to comment https://forums.phpfreaks.com/topic/20772-checkbox-php-small-problem/ Share on other sites More sharing options...
HuggieBear Posted September 14, 2006 Share Posted September 14, 2006 Can you actually show me the php?I need to see what's going in and coming out of the database.CheersHuggie Quote Link to comment https://forums.phpfreaks.com/topic/20772-checkbox-php-small-problem/#findComment-91979 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.