I insert an array of a checkbox in a mysql table
[seleccionael25] => Array
(
[0] => Oximetros de pulso
[1] => Linterna (Penlights)
[2] => Repuestos Littmann
[3] => Doppler fetal
[4] => Martillo de refeljos
[5] => Cubre-Fonendos
[6] => Tensiometros
[7] => Equipo de organos
[8] => Otros accesorios
[9] => Batas Greys Anatomy
)
I have used these codes without success
Test1 $articulo = $_POST[ 'seleccionael25'][0] ."-". $_POST['seleccionael25'][1] ."-". $_POST['seleccionael25'][2] ."-". $_POST['seleccionael25'][3] ."-". $_POST['seleccionael25'][4] ."-". $_POST['seleccionael25'][5] ."-". $_POST['seleccionael25'][6] ."-". $_POST['seleccionael25'][7] ."-". $_POST['seleccionael25'][8] ."-". $_POST['seleccionael25'][9]; //no funciona
Test2 $articulo = $_POST[ 'seleccionael25'] //Inserta unicamente la palabra "array"
Test3 $articulo = implode(',', $_POST['seleccionael25']); //No me funciona
Test4 $checkbox = array("seleccionael25" => $_POST[seleccionael25]);// codigo obtenido en jotform
$articulo = implode(',', $checkbox['seleccionael25']); //Test4
In the insert it is ok but it does not insert the array
$conexion->query( "INSERT INTO $tabla_db1 (pedido, seleccionael25, ......mas items) VALUES ('$pedido','$articulo', mas items)" );
Can someone tell me what I'm failing? I really do not give with the solution link
Update: SOLUTION found. the problem was that the varchar had a limit of 30 characters and when you selected several you went beyond the limit, increase the limit and you are ready