Questions tagged [zend-db-select]
117 questions
1
vote
1 answer
Zend_Db_Select join to Zend_Db_select
Two models are returned as Zend_Db_Select objects.
Then, I need to join them and fetch data together at once.
class Model_User extends Abstract_Model {
public function sqlUser() {
return $this->select(array(
'user_id',…

Crusader
- 1,182
- 11
- 22
1
vote
1 answer
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
LEFT OUTER JOIN results r ON s.id = r.id
WHERE r.id…

Honus Wagner
- 2,830
- 13
- 44
- 61
1
vote
1 answer
Using Zend_Db_Select to include several tables in one join
I know usage of Zend_Db_Select is optional, but I was wondering if there was a way to use it to generate the following SQL:
LEFT JOIN (pages p
, core_url_rewrite url)
ON p.page_id = mi.page_id
AND…

spooky
- 421
- 5
- 20
1
vote
1 answer
How to make multidimensional array from database query
table name = call
Table structure:
user_id | call_time | call_type|
Let's populate it for understanding
user_id | call_time | call_type|
0 2012-04-05 07:40:58 GMT+05:00 Mised
0 2012-04-06 08:58:45 GMT+05:00 …

Edward Maya
- 429
- 2
- 10
- 25
0
votes
1 answer
zend framework select object and complex joins
I am trying to learn to use the select object which is really comfortable to use, at least with less complex queries. Is there any limitations using this instead of manual sql queries?
I would prefer to use it everywhere in my application but…

Josef
- 585
- 1
- 7
- 19
0
votes
1 answer
Get just the name from mysql_query resource
$agent_query=mysql_query("
SELECT name FROM users WHERE id='$agent_id'
");
$get_agent_name=mysql_fetch_assoc($agent_query);
$this->session->agent=$get_agent_name['name'];
I know the…

newbie
- 1,023
- 20
- 46
0
votes
2 answers
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', $params);
$select = $db->select()
->from(array('dc'…

ryan
- 333
- 1
- 15
- 28
0
votes
2 answers
can`t resolve default schema in zend_db_select
why zend_db_select does not pick up schema from config file? and how can i fix it?
config:
resources.database.adapter = "Oracle"
resources.database.params.dbname = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521))…

Subdigger
- 2,166
- 3
- 20
- 42
0
votes
1 answer
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.
For eg:
Admin user is from New York. He can view…

Venu
- 7,243
- 4
- 39
- 54
0
votes
2 answers
how to get this query into Zend_db_select
I have the following query:
SELECT *
FROM
(SELECT products.uid, products.title, products.ean, products.description, products.price, products.date_publish, publishers.name, GROUP_CONCAT( CONCAT (authors.first_name, ' ', authors.last_name) SEPARATOR…

vthruu
- 3
- 2
0
votes
1 answer
Extracting query parts through Zend_Db_Rowset
I am building a class that only receive a Zend_Db_Rowset throught its params and from that I can extract the related Zend_Db_Table using the $rowset->getTable() method.
I was wondering if there is a way to get the order statement back from the table…

JF Dion
- 4,014
- 2
- 24
- 34
0
votes
1 answer
How to write RLIKE in zend framework 3?
I have a raw query something like:
SELECT * FROM caps WHERE `items` RLIKE '[[:<:]]20003[[:>:]]';
I've converted this query to 'zf3 select' format. I'm using Zend\Db\Sql\Select and extending TableGateway. Here is the converted zf3…

vinoth kannan kaniyappan
- 61
- 1
- 8
0
votes
1 answer
How do I select for something with a colon with Zend_Db_Select?
I have a query where I need to select text with a colon inside, basically it looks like this:
$select = $this->db->select()
->from('table')
->where(sprintf('tag = "%s"','foursquare:venue=12345'));
Now when I run this, I get the exception…

Dominik
- 125
- 1
- 7
0
votes
1 answer
Zend_Db_Select help with join
i'm using the following code and get the following error
$select = $model->select();
$select->from(array('stocktakejob'),
array("ProductID" => "stocktakejob.ProductID",
"TotalCount" => "SUM(stocktakejob.NewCount)"
…

roguecoder
- 187
- 1
- 2
- 8
0
votes
1 answer
how to change the order of columns in a query with joins using Zend_Db_Select
I have rather complex query and I could build it with Zend_Db_Select step by step. The query look likes this:
SELECT `subscribers`.`subscriber_id`, `subscribers`.`email_address`, `subscribers`.`first_name`,
`subscribers`.`last_name`, `t1`.`value` AS…

Oleg
- 2,733
- 7
- 39
- 62