Welcome Guest, Not a member yet? Register   Sign In
matrix type of checkbox insert
#4

my view to getting checkbox value
************************************

<td align="center"> <input type="checkbox" name="friend_id[]" value="<?php echo $row1['markid'];?>_<?php echo $row['regno'];?>" >
My controller
*************
function add_attend_studreg()
{
$this->load->library('form_validation');
$this->load->library('session');
$this->load->helper('url');
$this->form_validation->set_rules('friend_id','friend_id','required');
$matrix = $this->input->post('friend_id');

if(isset($_POST['Submit']))
{

$insert = array();
foreach($matrix as $m)
{
list($regno,$id) = explode ('_',$m);

//print_r($regno,$id);
$insert[] = array(
'item_id' =>intval($regno),
'user_id' =>intval($id)
);

$this->load->model('User_Model');
$this->User_model->studreginsert($insert);



}
}
}

My model
********
public function studreginsert($insert)
{
echo '<pre>';
print_r($insert);
echo '</pre>';
// echo "hai";
//$this->db->insert_batch('stud', $insert);
}

I got output as
****************


Array
(
[0] => Array
(
[item_id] => 50009
[user_id] => 2147483647
)

)
Array
(
[0] => Array
(
[item_id] => 50009
[user_id] => 2147483647
)

[1] => Array
(
[item_id] => 50011
[user_id] => 2147483647
)

)

2147483647 this type of value is not in my table. whats the problem in my query.kindly check it
Reply


Messages In This Thread
matrix type of checkbox insert - by kvanaraj - 07-05-2018, 04:48 AM
RE: matrix type of checkbox insert - by php_rocs - 07-05-2018, 08:25 AM
RE: matrix type of checkbox insert - by jreklund - 07-05-2018, 08:32 AM
RE: matrix type of checkbox insert - by kvanaraj - 07-05-2018, 10:20 PM
RE: matrix type of checkbox insert - by jreklund - 07-05-2018, 11:31 PM
RE: matrix type of checkbox insert - by kvanaraj - 07-05-2018, 11:46 PM
RE: matrix type of checkbox insert - by jreklund - 07-06-2018, 03:41 AM
RE: matrix type of checkbox insert - by kvanaraj - 07-06-2018, 05:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB