Questions tagged [zend-db-select]
117 questions
1
vote
1 answer
Zend Frameworks 1.12: how to join custom subquery table without returning results
I need to create the following query (this is just an example) using Zend Framework 1.12 as part of a larger query:
SELECT `s`.*
FROM `s`
INNER JOIN SELECT id FROM table where id = 13 AS `t`
Here's my attempt:
$query =…

Daniel
- 667
- 6
- 19
1
vote
1 answer
Zend SQL using string in join condition
I want to have a join like this:
$sql = new Sql($this->adapter);
$select = $sql->select();
$select->from(array('E' => 'Emails'));
$emailField =
$select->join(array('F' => 'EntityFiles'), "F.RelatedEntityId = E.EmailId AND F.RelatedEntityType =…

Bogdan
- 1,869
- 6
- 24
- 53
1
vote
1 answer
Zend paginator running very slow 1.12
I am using zend paginator for fetching records and listing the same.
There are four joins and I have indexed all the respective fields and I am getting only the required fields for listing in all the tables. Total number of records might be 5…

Prabhu Khanna Mahadevan
- 883
- 4
- 18
- 34
1
vote
3 answers
SELECT '0' AS variable ... with Zend_Db_Select
I am trying to create a select statement that uses the following structure:
$db
->select()
->from(
array('i' => ...),
array('provisional', 'itemID', 'orderID'))
->columns(array("'0' AS provisionalQty", "'ballast'…

webjawns.com
- 2,300
- 2
- 14
- 34
1
vote
2 answers
how to use of select with multi condition in zend framework?
i want to select rows with multi condition in zend framework how can i implement that/
1-example "select id,firstname,lastname,city from person where firstname=alex and city=xx ";
2-example "select id,firstname,lastname,city from person where…

ulduz114
- 1,150
- 6
- 21
- 37
1
vote
2 answers
Zend_Db order by field Value
I'm outputting the contents of a select menu from a model using this:
$select = $this->select();
$select->order('name');
return $this->fetchAll($select);
However, what i want to do is order by a specific value, and then by the name column. The SQL…

robjmills
- 18,438
- 15
- 77
- 121
1
vote
1 answer
query with parentheses in zend framework 2.2
I want my query like this:
SELECT tbl_bids. * , tbl_department.vDeptName, tbl_user.vFirst
FROM tbl_bids
LEFT JOIN tbl_bids_department ON tbl_bids_department.iBidID = tbl_bids.iBidID
LEFT JOIN tbl_department ON tbl_department.iDepartmentID =…

user3157253
- 83
- 1
- 6
1
vote
2 answers
SQL ordering by field in Zend Framework 2
How would you (elegantly) order a select statement by a field using closures in Zend Framework 2?
I have the following PHP code:
$gateway = new \Zend\Db\TableGateway\TableGateway('table_name', $adapter);
$select =…

Chris Kempen
- 9,491
- 5
- 40
- 52
1
vote
1 answer
Zend\Db\Sql\Sql row array
how can I create a multidimensional array? currently this query returns me this:
Array
(
[id] => 1
[name] => Samsung galaxy S4
[homepage] => 1
)
but I wish that I returned the data like this:
Array
(
[0] => Array
(
…

Carol Casta
- 75
- 1
- 9
1
vote
1 answer
add multi tables in from() zend_db_select
i have to do a select from multi tables using zend_db_select for this sql :
SELECT t1.id,t2.ids, t3.uid
FROM table1 t1,table2 t2, table3 t3
this is the code used :
$subQuery = $this->getDbTable ()->select ()->setIntegrityCheck ( false…

NoOneElse
- 1,101
- 2
- 11
- 15
1
vote
1 answer
How to select rows where a column value is empty/null using Zend_Db?
I have an SQLite database, eventually will be a MySQL database and I'm using Zend Framework. I'm trying to fetch all the rows in a table where the 'date_accepted' column is empty/null/doesn't have a value. This is what I have so far:
public function…

Andrew
- 227,796
- 193
- 515
- 708
1
vote
2 answers
Zend 2.1: Is it possible to do a multiple schema join via Db>Sql>Select
I'm pretty new to Zend and having a go with Zend Select abstraction. I have hit a bit of a problem when trying to create a query which joins another table from a different schema.
The mySql query I'm trying to produce is:
SELECT * FROM…

tomo661
- 88
- 4
1
vote
4 answers
MySQL Query to a Zend DB Select
I have a MySQL standard query that I need to convert into a Zend_Db_Select but I can't get it to work.
I get this error:
Select query cannot join with another table
Here's the query:
// THE COUNTER
$subselect = $this->table->select()->from(
…

Frederick Marcoux
- 2,195
- 1
- 26
- 57
1
vote
1 answer
Zend_Db nested queries where one query needs the ID from the other
I am fairly new to Zend Framework and have searched for days without finding an example for the following issue:
The result I am trying to achieve from the code below is a list that would have the main Category with the matching sub categories…

user1735078
- 21
- 3
1
vote
1 answer
Zend Framework: Select data from diffrent tables
I want to create a search engine in my site, but have one problem can I select all values from two or more different tables with one query, because have one category exp. News and in this category have subcategories and every subcategory have other…

Defense
- 259
- 4
- 21