Answer
class
Application_Model_Users extends Zend_Db_Table_Abstract {
protected
$_name
=
'users'
;
protected
$_primary
=
'id'
;
function users() {
$select
=
$this
->select()
->setIntegrityCheck(
false
)
->from(array(
'u'
=>
'users'
), array(
'name as t_name'
))->order(
'first_name asc'
)->order(
'last_name des'
);
return
$this
->fetchAll(
$select
);
}
}
class
Application_Model_Users extends Zend_Db_Table_Abstract {
protected
$_name
=
'users'
;
protected
$_primary
=
'id'
;
function users() {
$select
=
$this
->select()
->setIntegrityCheck(
false
)
->from(array(
'u'
=>
'users'
), array(
'name as t_name'
))->order(
'first_name asc'
)->order(
'last_name des'
);
return
$this
->fetchAll(
$select
);
}
}
5 Best Related Posts are Following: 1. How to set Cron in Zend Framework 2. Zend Framework Interview Questions and Answers for Experienced - Page 2 3. Zend Framework Interview Questions and Answers for Experienced 4. Zend Framework Interview Questions and Answers 5. Zend Framework - Free Google Analytics API
Most Popular Posts in Last 30 Days
Question: What is AngularJS? It is javasScript framework which is written in javascript. It is Best for Single Page Applications. I...
Bootstrap is Javascript framework which is used for building the rich web applications with minimal effort.Bootstrap, a sleek, intuitive...
Wordpress is opensource content management system where you can add/update/delete contents from admin section. Content may be text, ima...
Question: What are the current versions of apache, php, and mysql? Answer: PHP: php 5.5 Apache: Apache 2.2 MySQL: MySQL 5.5 Ques...
Question: What is node.js? Node.js is a software for scalable server-side and networking applications . Node.js applications are wri...
Question: What is full form of SEO? S earch E ngine O ptimization. Question: What are two types of SEO? On Page Optimization Of...
What is Object Oriented Programming? Object-oriented programming (OOP) is a programming language model organized around objects rather tha...
Question: What is PEAR in php? PEAR means PHP Extension and Application Repository. PEAR is a framework and distribution system for reus...
Question: What is backbone Js? It is JavaScript framework which helps to write the code in organize way and reduce the development tim...
Question: How to disable layout from controller? $this->_helper->layout()->disableLayout(); Disable Zend Layout from contr...
All zend Framework 2 Questions
Ask your interview questions on zend-framework-2
Write Your comment or Questions if you want the answers on zend-framework-2 from zend-framework-2 Experts
How to concatenate two columns in query in Zend Framework?
Reply$select->from(array('u' => 'users'), array('id','city_id','name','username'))
->joinLeft(array('c' => 'cities'), "u.city_id=c.id", array('city_name'=>new Zend_Db_Expr("CONCAT(city, ', ', country)")));