Welcome Guest, Not a member yet? Register   Sign In
[solved] get db result
#1

[eluser]kaejiavo[/eluser]
Hi guys,

i have a problem with a db result. My code:

Code:
function get_shop_items($shop_id) {
    $this->db->select('items_id');
    $this->db->where('shops_id', $shop_id);
    $this->db->from('item_shops');
    $query = $this->db->get();

    return $query->result_array();
    }

returns an array:
Code:
Array ( [0] => Array ( [items_id] => 3 ) [1] => Array ( [items_id] => 7 ) )

but i need:
Code:
Array ( [0] =>  3 [1] => 7 )
because i want to use it to select options in a form_multiselect.

Is there any way to return only the values with db library, or do i have to circle the values and build my own array?

TIA
Marco


Messages In This Thread
[solved] get db result - by El Forum - 08-22-2010, 09:25 AM
[solved] get db result - by El Forum - 08-22-2010, 12:37 PM
[solved] get db result - by El Forum - 08-22-2010, 09:00 PM
[solved] get db result - by El Forum - 08-23-2010, 03:12 AM
[solved] get db result - by El Forum - 08-23-2010, 04:06 AM
[solved] get db result - by El Forum - 08-23-2010, 04:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB