samedi 25 mars 2017

checkbox node ER_BADD_NULL_ERROR: Column ' ' cannot be NULL

I have a form with a checkbox i want the data to upload into my sql database.

<ul>
        <li>
            <input type="checkbox" name="belgie" value="1">België</li>
        <li>
            <input type="checkbox" name="denemarken" value="1">Denemarken</li>
        <li>
            <input type="checkbox" name="duitsland" value="1">Duitsland</li>
        <li>
            <input type="checkbox" name="frankrijk" value="1">Frankrijk</li>
        <li>
            <input type="checkbox" name="italie" value="1">Italië</li>
</ul>

I want to import the value into my database, but i get an error. The checkboxes that are not checked, give a value of NULL. I want the values of the unchecked boxes to be 0. If i try input type"hidden" name="belgie" value="0"/ i also get error, because there are 2 values, 0 and 1. please help!




Aucun commentaire:

Enregistrer un commentaire