Using Check Boxes in Forms
I'm hardly a PHP guru, and need to use a check box to indicate whether an online article is active for display or not.
I have a check box for active in the Search, Update, and Insert pages. The articles database has a column called 'active'. The datatype is tinyint, NOT NULL, default = 0 (false).
What code do I alter to have the check box display as checked in the Update page when the article is already active and called to Update, what code is needed to insert a 0 in the Insert or Update pages when the article is not active, and use an unchecked value of 0 for searching for inactive articles and a checked value of 1 searching for active articles.
Error message for Insert and Update is "Column 'active' cannot be null. This occurs when the Active checkbox is left unchecked.
Thanks. . .
ETA: Search actually works okay -- finds active articles when checked and inactive when unchecked. . .