tags:

views:

78

answers:

1

I have a next code:

    $parent_priority = $data['priority'];
    $where = $this->getAdapter()->quoteInto('priority >= ?', $parent_priority);
    $columns = array ('id',
                      'title',
                      'enabled',
                      'description',
                      'pv',
                      'gv',
                      'mps', 'priority',
                      );
    $select_data = $this->select()->from($this->_name, $columns);
    $ranks = $this->fetchAll($select_data)->toArray();

But Zend create an error "Column not found: 1054 Unknown column '0' in 'field list'" in line $ranks = $this->fetchAll($select_data)->toArray();

How I can solve this?

A: 

Just suppress the last "," from your array after 'priority'.

M42
That's not how arrays work in PHP... A trailing `,` won't add anything...
ircmaxell