elfuego1
elfuego1

Reputation: 10348

PHP - acquiring array from an object

In PHP I have this result from MSSQL database:

CI_DB_odbc_result Object ( [num_rows] => 5 [conn_id] => Resource id #34 [result_id] => Resource id #49 [result_array] => Array ( [0] => Array ( [NO1] => 119 [NO2] => 115 [NO3] => 123 [NO4] => 127)

Can you please tell me how do I access/extract [result_array] => Array ( [0] => Array ( [NO1] => 119 [NO2] => 115 [NO3] => 123 [NO4] => 127) into plain PHP array?

Upvotes: 0

Views: 173

Answers (1)

Benjamin Powers
Benjamin Powers

Reputation: 3256

The array can be accessed by the object property.

$result = CI_DB_odbc_result->result_array;
print_r($result);

Upvotes: 1

Related Questions