CodeIgniter Forums

Full Version: array - array
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hi All..

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

function getDataGraph($idvims_summary) {
            $query = $this->db->query("SELECT
                                            DATE_FORMAT(time,'%H:%i') AS time,
                                            b.id_event AS id_event,
                                            c.description AS description
                                            tblvims_detsummary AS a
                                        LEFT JOIN tblvims_summary AS b ON b.idvims_summary = a.idvims_summary
                                        LEFT JOIN tblid_event AS c ON = b.id_event
                                            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;

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

can you give me right code?

Thanks, pipiet :-) ..

El Forum

$rowData['time'] = $row["time"];
$rowData['value'] = $row["value"];
$rowData['id_event'] = $row["id_event"];
$rowData['description'] = $row["description"];