Welcome Guest, Not a member yet? Register   Sign In
Two almost identical methods but one failing
#2

[eluser]cahva[/eluser]
Does the former return anything as now it would definately give syntax error or did you just forgot to paste the whole method? Smile

Was it supposed be like this:
Code:
function create_client_list()
{
    $clients = array();
    $client_values = NULL;
    $client_keys = NULL;
    $this->db->select('name');
    $this->db->distinct();
    $this->db->order_by('name');
    $clients = $this->db->get('tbl_clients');
    $query = FALSE;
    
    if ($clients->num_rows() > 0)
    {
        foreach ($clients->result() as $client)
        {
            $client_keys[] = $client->name;
            $client_values[] = $client->name;
        }
        $query = array_combine($client_keys, $client_values);
    }
    return $query;
}


Messages In This Thread
Two almost identical methods but one failing - by El Forum - 02-12-2011, 06:34 PM
Two almost identical methods but one failing - by El Forum - 02-12-2011, 09:08 PM
Two almost identical methods but one failing - by El Forum - 02-12-2011, 11:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB