How to store input from checkboxes into MySQL using PHP?

I wish to supplement categories to the companies database. Based upon an additional educational we done 3 tables:

companies
categories
lookup_category

lookup_category someway stores the attribute in between the alternative two, though the tutorial’s e.g. formula was full of errors as well as gaps, so I’m stuck.

What’s the many efficient/flexible approach to supplement “a categories dimension” to the pick up of annals in MySQL? Can any one give the nude down operative e.g. but BS?

Thanks!

One thought on “How to store input from checkboxes into MySQL using PHP?

  1. You can’t check checkboxes in Php, but you can set values in javascript that will be passed to Php:
    the form:

    function js_check(theForm)
    {
    if (theForm.elements['checkbox1'].checked)
    theForm.elements['phpbox1'].value = 1;
    if (theForm.elements['checkbox2'].checked)
    theForm.elements['phpbox2'].value = 1;
    }
    Your receiving Php script reads phpbox#. If set to 1, then box is checked.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>