Questions tagged [zend-db-select]
117 questions
0
votes
3 answers
Select ignores where clause using Zend_Db_Select
$table = new Zend_Db_Table(array('name'=>'rules'));
$select = $table->select();
$select->setTable($table);
$select->setIntegrityCheck(false);
$select = $select
->from(array('ru'=>'rules'),array('ru.*'))
…

Omar
- 8,374
- 8
- 39
- 50
0
votes
1 answer
Need help with zend_select() Join
I'm currently working with Zend framework and I need help to convert this query to zend_select() format. Can someone kindly help me out please
Thanks so much in advance!
SELECT p .*
FROM provider p
INNER JOIN providerReligionPreference prp ON…

user648198
- 2,004
- 4
- 19
- 26
0
votes
0 answers
How to group by with Zend Db
I use zend framework 2 and I want to create this select:
SELECT
MONTH(created_at) month, COUNT(*)
FROM
requests
GROUP BY
YEAR(created_at), MONTH(created_at)
This is my function I use:
public function statPerMonth() {
$select =…

Mondy
- 2,055
- 4
- 19
- 29
0
votes
1 answer
columns of joined table missing
I'm missing the columns of a joined table. I have two tables like:
t_q_filialen 1 --> n t_mandant
I did my select statement in my model as follows:
$select= new Select (); //another try ('t_mandant','t_q_filialen');
…

pia-sophie
- 505
- 4
- 21
0
votes
2 answers
zend_db_select join using 3 or more tables
So Zend_db_select has the methods
`joinUsing(table, join, [columns]) and joinInnerUsing(table, join, [columns])`
`joinLeftUsing(table, join, [columns])`
`joinRightUsing(table, join, [columns])`
`joinFullUsing(table, join,…

kamikaze_pilot
- 14,304
- 35
- 111
- 171
0
votes
1 answer
Sql (zend db select) of multiple selects
I need a bit of help.
I have (reference?) table with columns: id , user_id , key , value
It is pretty much a user profile table
and I would like to have SQL (I am using zend db table, but general SQL help will do) where I get "all 'user_id's where…

DavidHavl
- 347
- 3
- 10
0
votes
2 answers
Chech if any rows were selected with Zend_Db_Select
I'm selecting a post from my DB table and I'm getting the id from the url with getParam(). What I want to do is, show an error message when there's no posts with the id specified in the url.
This is the query I have:
$db =…
user393964
0
votes
1 answer
How to initiate Zend_Db_Select object?
Hey guys,
I'm having truble figuring this out: how do I initiate a zend_Db_Select object with the resources from my application.ini?
$db = Zend_Registry::get('db');
$select = $db->select();
But it's not working, I guess I have to add db to the…
user393964
0
votes
1 answer
zend_db_select use with zend_db_table_abstract
I'm not sure how to do this: My Post model is extending Zend_Db_Table_Abstract and I'm working on my homepage right now, where I want to show every post from the DB. The documentation says that fetchAll() and fetchRow are deprecated, and that I…
user393964
0
votes
2 answers
Php Zend Framework : Using Zend_Db_Select to return objects
Currently right now I'am using Zend_DB_Select, I would like to return the rows as objects so that I can use methods like save(), delete()
Function includes:
$table = self::instance();
$select = $table->getAdapter()->select();
…

slik
- 5,001
- 6
- 34
- 40
0
votes
2 answers
add column to select object zend framework
Here is my current code:
$Select=new Select();
$Select->from($this->getTable());
What I want now is to add the id column but as DT_RowId instead of id. How do I accomplish this? The goal would be to have all of the table columns as well as this new…

somejkuser
- 8,856
- 20
- 64
- 130
0
votes
2 answers
Zend DB Select nested Joins
I'm trying to realize the following query with zend db select:
SELECT `uac`.`uid`, `u`.`uid`, `g`.`groupid`, `g`.`packageid`
FROM `user_has_data` AS `uac`
INNER JOIN `users` AS `u` ON u.uid = uac.uid
LEFT JOIN (`user_in_group` AS `uig`
INNER…

max
- 13
- 3
0
votes
1 answer
How to use pagination with JOINs in Zend Framework 2?
In an application I implemented a Mapper to retrieve data from the database and objects from the ResultSet. In order to get all the data I have to JOIN multiple tables. Then I get a huge array structured like this:
[
0 => [
main_id =>…

automatix
- 14,018
- 26
- 105
- 230
0
votes
2 answers
How does one query a Zend_Db_Table_Row
Is it possible to run an SQL (Zend_Db_Select) query against a Zend_Db_Table_Row object? What about joining two Zend_Db_Table_Row objects?
I know it sounds a bit retarded, but I'm processing hundreds and thousands of rows. I already have the row…

d-_-b
- 6,555
- 5
- 40
- 58
0
votes
1 answer
Zend Framework: How Do I 'auto' generate a SQL query correctly
I want to generate the following SQL:
SELECT `rc`.*, `c`.`name` FROM `RunConfigurations` AS `rc` INNER JOIN `Clients` AS `c` ON rc.client_id = c.id WHERE (rc.client_id = ?) ORDER BY `rc`.`config_name` ASC
However I am getting:
SELECT `rc`.*, `c`.*…

ashurexm
- 6,209
- 3
- 45
- 69