Questions tagged [zend-db-select]

117 questions
0
votes
1 answer

How to form this zend_db_select statement to compare timestamp

This is what i am trying to do. id ip timestamp userid 9 127.0.0.1 2013-06-27 16:52:49 35 I would like to first query table to see if ip for the user is persisted. If so, he/she voted 2) Check timestamp of vote against current…
Slay
  • 1,285
  • 4
  • 20
  • 44
0
votes
2 answers

How can I improve the following mysql selects?

I am currently refactoring a legacy application and converting piece by piece over to zend framework 1.12. I am scratching my head as to how to convert this over to zend db, is there a way that this can be done in one query? Right now I see that it…
MikeGA
  • 1,262
  • 4
  • 17
  • 38
0
votes
2 answers

Issue with quoting of IS, NULL, NOT, !, and other reserved strings in ON conditions of JOIN clauses in Zend Framework 2

I have an SQL statement, that selets sport classes/courses (courses) with their trainers (trainers) over an association table (courses_trainers). Since some courses have multiple trainers, I use the GROUP_CONCAT(...) function to get the trainer…
automatix
  • 14,018
  • 26
  • 105
  • 230
0
votes
1 answer

ZF2 complex SQL where closes

How can I create complex WHERE closes in Zend\Db\Sql? Those with "COLLATE utf_general_ci" or "REGEXP". Also what is the way to feed it the query as a string I want? Thank you!
Brock
  • 1,635
  • 2
  • 18
  • 27
0
votes
1 answer

SetIntegrityCheck from DB Adapter in Zend

Hi there I want to use join in zend db select. I know that setintegritycheck() is importants in joins. I know how to implement it when I am having a model object like $select =…
Awais Qarni
  • 17,492
  • 24
  • 75
  • 137
0
votes
1 answer

Zend select data from multiple table

I have trouble with pulling data from two different tables. I'm attempting to first grab all the addresses with a given name (select all the addresses with the name tom in table). Then with the addresses, look through another table (table2) for…
michael liu
  • 55
  • 1
  • 7
0
votes
1 answer

ZendFramework2 AbstractTableGateway getSql

I got a ZF2 project with 2 Models PosTable/TopTable which extend AbstractTableGateway. I want to Paginate results from those Tables so i have a Pagination function in both of them. this is what the PosTable Model looks like: ... class PosTable…
0
votes
1 answer

Zend Framework: Select the greatest number from table columns

How can I select the greatest number from table columns, exp. that is my table: id|name|views| 1|test|42| 2|test1|89| 3|test2|4| 4|test3|35| I need to select all values for row id 2, because views is most greatest number from…
Defense
  • 259
  • 4
  • 21
0
votes
2 answers

Zend_db_Select multiple where but with variable clauses possible?

Is it possible to dynamically create a select statement with multiple where() clauses? Suppose a function that takes multiple arguments. If the Nth argument is non-empty, add a ->where('sth = ?", $value) clause in the statement and do that for all…
johnjohn
  • 4,221
  • 7
  • 36
  • 46
-1
votes
1 answer

how to use joins in Zend_Paginator_Adapter_DbSelect()

how can i replace below mysql query to ZF Zend_Paginator_Adapter_DbSelect() query $sql = "SELECT ps.phone_service_id,ps.phone_service_name,ps.phone_service_Duration,ps.phone_service_type,us.user_preferences_value,ps.user_id FROM phone_service…
Fawad Ghafoor
  • 6,039
  • 7
  • 41
  • 53
-1
votes
0 answers

Zend_Db_Select won't allow column values from joined tables

I am having a problem getting Zend_Db_Select to give me column values from joined tables. For example, this join works: $select->from(array('a' => 'files'), array('fil_last_name','fil_first_name','fil_middle_name')) …
tjb1982
  • 2,257
  • 2
  • 26
  • 39
-1
votes
1 answer

Zend_Db magic method specific cell selection

Currently I'm working on a couple of model related improvements and looking into a specific query I've wrote. $queryGetPages = $this->fetchAll($this->select() ->where('page_active = ?', (int) $active) …
Willem Poortman
  • 121
  • 1
  • 13
1 2 3 4 5 6 7
8