I have to generate an array with this syntax array( 100 => [ 68, 69, 72 ], 103 => [ 68, 69, 72 ], 205 => [ 68, 69, 70, 71, 72 ], 343 => [ 68, 69, 72, 73 ] )
The first field is equivalent to sizes and the second to the colors assigned to those sizes. I have the data stored in mysql for a value separated by commas with what I do an explode to separate them and generate an array.
the fields to consult would be sizes that is a varchar and colors that is another varchar and both store numbers separated by comma 100,101,135,120
the query I'm doing it like this:
$consulta = "select * from 'Articulos' where 'id'= 111 ";
$resultado = mysqli_query($Conectar, $consulta);
$datos = mysqli_fetch_array($resultado);
$taLlas = explode(",", $datos['talla']);
I'm not sure what the syntax would be to generate it.
Thank you very much everyone for your help.