Welcome Guest, Not a member yet? Register   Sign In
Using dynamic data for array creation
#1

[eluser]Wittner[/eluser]
Hi,

I had a query which went something like this:
(All of the below code is rough code for illustration purposes)

Code:
== CONTROLLER ==
// DB data
$inputData = array(
    'field1' => $field1,
    'field2' => $field2
);

$this->model->update_db($inputData);

== MODEL ==
$this->db->update('tablename', $inputData);

.. all of which worked fine

Now I want to dynamically create the array data in the controller from a query in a model, something like this:

Code:
== CONTROLLER ==
$inputData = $this->whatever_model->get_my_data();
$this->model->update_db($inputData);

== MODEL ==
$this->db->update('tablename', $inputData);

I think the result in the new version is begin returned as an object and not an array. Can anyone tell me the proper approach for this?

cheers,

Wittner


Messages In This Thread
Using dynamic data for array creation - by El Forum - 01-21-2010, 03:52 AM
Using dynamic data for array creation - by El Forum - 01-21-2010, 03:58 AM
Using dynamic data for array creation - by El Forum - 01-21-2010, 04:47 AM
Using dynamic data for array creation - by El Forum - 01-21-2010, 05:26 AM
Using dynamic data for array creation - by El Forum - 01-21-2010, 05:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB