Ver Mensaje Individual
  #7 (permalink)  
Antiguo 03/05/2013, 10:30
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Problema con arrays asociativos/dinamicos

Puedes generar todo desde el mismo array, si los datos son los que pones en la tabla puedes generar tu array así:
Código PHP:
Ver original
  1. $timeline = array();
  2. while ($row = mysql_fetch_row($result)) {
  3.          $jc = $row[0];
  4.          $hora = $row[1];
  5.          $num = $row[2];
  6.  
  7.          if (!isset($timeline[$jc])) $timeline[$jc] = array();
  8.  
  9.          $timeline[$jc][$hora] = $num;
  10. }
  11.  
  12. var_dump($timeline);

Saludos.