mysql - Selecting column alias filled with NULLs with Zend_Db -
is there way can select null column zend_db. make clear, write query:
select id, name, age, null ssn dummy_table;
the result have 4 columns id, name, age , ssn(filled null). there way in zend_db. guess was:
$columns = [ 'id' => 'id', 'name' => 'name', 'age' => 'age', null => 'ssn' ]; $select = $this->_db->select(); $select ->from('dummy_table', $columns)
but won't work generate:
select `dummy_table`.`id` `id`, `dummy_table`.`name` `name`, `dummy_table`.`age` `age`, `dummy_table`.`ssn` `` `dummy_table`;
this query fail. there way using zend_db ($this->_db->query('') not option)?
have tried using new zend_db_expr('null')
?
you :
$null = new zend_db_expr('null'); $columns = [ 'id' => 'id', 'name' => 'name', 'age' => 'age', $null => 'ssn' ]; $select = $this->_db->select(); $select ->from('dummy_table', $columns);
Comments
Post a Comment