Tagged Questions
0
votes
2answers
41 views
convert Zend Db Select query to sql query
Are there any ways to convert Zend db Select or Zend DB query to SQL query before querying the database? Any other workarounds?
As I want to build a more complex SQL query that Zend DB cannot ...
5
votes
3answers
115 views
How to write a subquery refactoring WITH clause using Zend framework?
I want to use the WITH syntax inside the SQL query in Zend framework, the SQL looks like this:
WITH t AS
(SELECT item_id, row_number() OVER (ORDER BY some_criteria DESC) rn
FROM orders)
SELECT ...
0
votes
1answer
43 views
Replicate a MySQL LEFT OUTER JOIN with Zend_Db_Select
I have tried over and over again to replicate my MySQL query using the Zend_Db_Select object and I can't replicate the results in Zend.
The MySQL query:
SELECT s.id, s.project_id
FROM staging s
...
0
votes
1answer
52 views
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 = ?", ...
0
votes
1answer
57 views
Zend modification. Adding MySQL FORCE INDEX hint
I am trying to extend the Zend library in order to get queries like this one:
SELECT * FROM item i **force index(ix)** ORDER BY date LIMIT 100;
I am working arround with this Zend forum issue ...
0
votes
2answers
134 views
Use of select queries in Zend Framework without providing database info
I use select queries as by following code:
$params = array(
'username' => 'root',
'password' => '',
'dbname' => 'mst2');
$db = Zend_Db::factory('pdo_mysql', ...
0
votes
1answer
292 views
extending zend db select
I am building a CMS kind of site, There will be lot of admin users. ACL was in place for business layer. But now we want to apply custom ACL logic to models based on city in which admin user belongs.
...
0
votes
0answers
103 views
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'), ...
0
votes
1answer
260 views
Zend_Db_Select LIKE clause
How can I set this query
SELECT city_id FROM cities WHERE city_name LIKE "%Vicenza%"
using the Zend_Db_Select class?
1
vote
4answers
102 views
How to inspect every query going to DB from Zend Framework
I have a complex reporting application that allows clients to login and view reports for their client data. There are several sections of the application where there are database calls, using various ...
0
votes
2answers
952 views
Zend_Db_Select: LEFT JOIN on a subselect
I have a query, that does a LEFT JOIN on a subselect. This query is run in a high load environment and performs within the set requirements. The query (highly simplified) looks like:
SELECT
...
0
votes
1answer
311 views
zend db join resultset
I used zend_db_select for joining 3 tables, and in the result set array while I was expecting to see the column names with aliases, it returns an array with keys having no aliases.
$dbSelect = ...
0
votes
1answer
229 views
Escaping input for LIKE in Zend_Db
What is the right way to escape text that is passed to query with LIKE pattern matching?
The problem is that
select()->where('field LIKE ?', $input . '%');
will be incorrect with
$input = ...
0
votes
1answer
429 views
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 ...
0
votes
2answers
337 views
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();
...