Welcome Guest, Not a member yet? Register   Sign In
Dropdown from DB Alphabetized
#3

[eluser]I666I[/eluser]
Thanks, but unfortunately that's not doing it. It is still ordering the list by row id. Here is what my code looks like:
Code:
$this->db->query('SELECT last FROM Names ORDER BY last ASC');
                $query = $this->db->get('Names');
                foreach ($query->result() as $row){
                    $data['Names'] [$row->last] = $row->last;
                }
                
                //LOAD  VIEW AND DATA FOOL
                $this->load->view('index_view', $data);
view:
Code:
$formAtt = array('id'=>'selClient');
                echo form_open('selectClient', $formAtt);
                    $js = 'onChange = alert(document.selClient.clients.options[document.selClient.clients.selectedIndex].value)';
                    echo form_dropdown('clients', $Names, 'Select Client', $js);
                    echo form_close();
                ?>
No matter what I try in the sql statement, it still is ordering the list by the id of the row. Much thanks for the help.


Messages In This Thread
Dropdown from DB Alphabetized - by El Forum - 09-11-2007, 10:46 AM
Dropdown from DB Alphabetized - by El Forum - 09-11-2007, 12:35 PM
Dropdown from DB Alphabetized - by El Forum - 09-11-2007, 01:16 PM
Dropdown from DB Alphabetized - by El Forum - 09-11-2007, 01:23 PM
Dropdown from DB Alphabetized - by El Forum - 09-11-2007, 01:45 PM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 11:41 AM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 11:50 AM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 12:05 PM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 12:21 PM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 12:27 PM
Dropdown from DB Alphabetized - by El Forum - 09-12-2007, 12:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB