• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
array - array

#1
[eluser]pipiet06[/eluser]
Hi All..

I got a problem with my code.
the resulte of my data is "Array - Array"
how to solve that?

models.
Code:
function getDataGraph($idvims_summary) {
            $query = $this->db->query("SELECT
                                            DATE_FORMAT(time,'%H:%i') AS time,
                                            value,
                                            b.id_event AS id_event,
                                            c.description AS description
                                        FROM
                                            tblvims_detsummary AS a
                                        LEFT JOIN tblvims_summary AS b ON b.idvims_summary = a.idvims_summary
                                        LEFT JOIN tblid_event AS c ON c.id = b.id_event
                                        WHERE
                                            a.idvims_summary = '$idvims_summary'");

            if ($query->num_rows() > 0) {
                $rec = $query->result_array();
                $rowData = array();
                foreach($rec as $row){
                    $rowData['time'][] = $row["time"];
                    $rowData['value'][] = $row["value"];
                    [size=3]$rowData['id_event'][] = $row["id_event"];
                    $rowData['description'][] = $row["description"];[/size]
                }
                return $rowData;
            } else {
                return FALSE;
            }
        }


Code:
$data = $this->MDet_summary->getDataGraph($idvims_summary);
if (!$data) {
    exit;
}
            
$time = $data['time'];
$value = $data['value'];
$title = $data['id_event']." - ".$data['description'];

can you give me right code?

Thanks, pipiet :-) ..

#2
[eluser]Mat-Moo[/eluser]
Code:
$rowData['time'] = $row["time"];
$rowData['value'] = $row["value"];
$rowData['id_event'] = $row["id_event"];
$rowData['description'] = $row["description"];


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.