Welcome Guest, Not a member yet? Register   Sign In
Codeigniter passing checkbox array values to mysql database
#2

[eluser]comyou[/eluser]
I haven't tested it but I'm sure you should be checking if it's checked or not.

Try something like:
Code:
if(isset($this->input->post('fanta'))) {
                $data['fanta'] = '1';
} else {
                $data['fanta'] = '0';
};

That should check if the checkbox is checked and return '1' is so, that way any value in your Database other than '1' is a false.

Apologies if it doesn't work.


Messages In This Thread
Codeigniter passing checkbox array values to mysql database - by El Forum - 02-25-2014, 05:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB