Ver Mensaje Individual
  #8 (permalink)  
Antiguo 23/02/2013, 15:59
Avatar de ch3ssmaster
ch3ssmaster
 
Fecha de Ingreso: enero-2011
Mensajes: 97
Antigüedad: 13 años, 4 meses
Puntos: 5
Respuesta: Array asociativo desde consulta

Estoy intentandolo con una función que encontré en el manual:

Código:
if (array_key_exists($row['tema'], $temas_assoc)) {
                    $temas_assoc[$row['tema']] = $row['subtema'];
                } else {
                    $temas_assoc[$row['tema']] = array($row['subtema']);
                }
pero no funciona bien, me da este array:

Código:
Array ( [0] => Array ( ) [3] => 7 [4] => Array ( [0] => 7 ) [1] => 4 [2] => Array ( [0] => 7 ) )
__________________
Diseño Web profesional y creativo: WebSystem.