Database access component for the Zend Framework.

learn more… | top users | synonyms

0
votes
1answer
31 views

Zend/db/Sql/ query syntax

Hi everyone I am starting with Zend Framework 2 , I want to make a routing choice with the role of My user and i must write getRoleByID($id) , then How can'I write " Select 'role' from user ...
-1
votes
0answers
17 views

Application Error When inserting data in Zend Framework

When I tried to insert dta in my mysql table, its showing me APPLICATION ERROR. Can someone please help me out in this?? Model public function add($array){ $chip=new ...
1
vote
1answer
35 views

ZF2 + Zend\Db\Sql\Update, adding to current value

I'm trying to do something relatively simple but can't figure it out. I just want to add to a current value in the DB is there anyway to do the equivalent of a: UPDATE `tablename` SET fieldB = ...
0
votes
2answers
40 views

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 ...
0
votes
2answers
30 views

zend framwork database connection not working

I am try to do database connection in zend framework Below is my application.ini [production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 includePaths.library = ...
1
vote
2answers
50 views

Zend Framework 2 Sql Select with OR and AND

I want to make this query using Zend\Db\Sql\Select: SELECT table1.* FROM table1 INNER JOIN table2 ON table1.columnA = table2.columnB INNER JOIN table3 ON table1.columnC = table3.columnD ...
0
votes
0answers
20 views

zend db table Model Ondelete Restrict doesn't work

I have two table and use this method in model to delete row but if row has child this method delete the row ! I set this in the model: 'onDelete' => self::RESTRICT, 'onUpdate' => ...
0
votes
2answers
42 views

Multi Login ZF2 with multi session

I have an application with 3 different logins (3 different dashboard). Not to write duplicate code I created an adapter and a plugin to login. Now how can I manage 3 different sessions. If I run in ...
0
votes
1answer
58 views

Zend Framework 1.12, execution of raw SQL inserts the same record twice

I know there´s a similar situation in stack, and I´ve already checked it out and the answers have not guided me to mine. Here´s the deal: I need to execute raw SQL, an INSERT to be precise. I have ...
0
votes
1answer
24 views

How to make this query in Zend DB?

I'm trying to have Zend DB generate the following query: SELECT DISTINCT US.nombre AS Cliente, VE.id_venta, VE.fecha, VE.total, ve.observacion FROM usuarios AS US, ventas ...
-1
votes
0answers
35 views

SQL logic merge multiple table

I got a question on SQL logic that need you guys to help. I have selected a query from Table A and got the required fields. Now, say field A, I want to check if this field exists in table B. If ...
-1
votes
1answer
37 views

How to use Zend\Db in Zend Framework 2 in a real world project? A quest about foreign keys and relationships

I've completed the tutorial of Zend 2 and feel a bit disappointed by the Zend\Db component. Indeed, it's not able to handle foreign keys (as a built in). How to approach this problem for a real world ...
0
votes
3answers
45 views

Explain this Zend_Select and Convert to SQL Query?

$select->from(array('u'=>'user'),array('count'=>'distinct count(*)')) ->joinLeft( array('d' => 'details'), ...
0
votes
2answers
59 views

Zend Db Sql Where

Hi how can I do a query like this in zf2 with zend\db\sql? Query: SELECT * FROM table WHERE field = $field AND data > SUBDATE(NOW(), INTERVAL 1 DAY) In ZF2 $select = ...
0
votes
2answers
53 views

Zend:Fetching Data from Multiple tables

Please find my code below module.php public function getServiceConfig() { return array( 'factories' => array( 'Shopping\Model\ShopTable' => function($sm) { $tableGateway = ...
0
votes
2answers
36 views

Simple Zend Db function returning fatal error “Call to a member function toArray() on a non-object”

In my model I have the following function protected $_users ='users'; public function getbyid($user_id) { $select = $this->_db ->select() ->from($this->_users) ...
0
votes
1answer
47 views

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 ...
0
votes
1answer
29 views

Zend_Db_Table_Exception: A table must have a primary key, but none was found

I want to insert data in a table using zend framework . I have following table structure When I try to insert data in this table I found error Zend_Db_Table_Exception: A table must have a ...
1
vote
1answer
70 views

Zend Framework 2 Double Quotes in Queries

I'm using the Zend Framework 2 for application developement. The whole application is based on a IBM Informix database. The database configuration looks something like this: return array( 'db' => ...
0
votes
2answers
17 views

Fatal exception in loading ini file

My project folder is demo, inside which I have the folders application, library and public. Inside the application folder, I have a folder named configs, inside which I have a file 'application.ini', ...
0
votes
0answers
42 views

Zend_Db_Table::getDefaultAdapter returns NULL

i'm trying to use $db = Zend_Db_Table::getDefaultAdapter(); But it returns NULL I tried to add resources.db.isDefaultTableAdapter = true in my application.ini but no changes ...
0
votes
0answers
52 views

Zend Framework 2 - Doctrine - Timestamp Annotation not working

I've got the following problem: I need a created_at field. I thought I solved the problem as follows: /** * @Version @ORM\Column(type="datetime") * @Form\Attributes({"type":"text"}) * ...
1
vote
0answers
41 views

Zend Framework retrieving value from DB

use Zend\Db\TableGateway\TableGateway; use Zend\Db\TableGateway\AbstractTableGateway; use Zend\Db\TableGateway\Feature; use Zend\Db\Sql\Select; use Zend\Session\Container; Hi i am new to ZF2 and i ...
0
votes
0answers
17 views

zend db returns junk when called from controller but when result dumped in the model it is fine

Weird problem I have the following model in which if I call getSystemgoals() from a controller all is well and array of results are returned. Whenever I call getSystemactivities() what appears to be ...
0
votes
1answer
51 views

Zend Framework 2 - How to access DB adapter in controller

Despite several hits on Google I still couldn't find out how to access the db adapter I configured in my global.php in any controller. I found this: $db = ...
0
votes
1answer
49 views

Fetch image path from mysql and show image on web page

<select id="availableFruits" name="availableFruits" multiple size=7 style="width:auto;float:left;" > <?php $fruitList=$this->fruitList; foreach ($fruitList ...
1
vote
2answers
149 views

zf2 - Zend\Db - What do Model, Entity, Hydrator, Mapper, TableGateway do and how it all links together?

Please explain what Model Entity TableGateway Mapper Hydrator do and how it all works together in zf2 application. please don't give links to blogs articles. I need simple big picture ...
2
votes
2answers
76 views

Can I set a query timeout when using Zend_Db_Adapter_Pdo_Mssql?

We have a PHP application (hosted on Linux) which uses Zend Framework components to query a Microsoft SQL Server 2008 database. The PHP application is hosted in a datacenter with reliable internet ...
3
votes
2answers
121 views

Convert Zend\Db\ResultSet\HydratingResultSet to Array of Objects

In my Mapper class I'm extending AbstractDbMapper from ZfcBase to fetch rows from the database. A simple example would be code like this: class MyMapper extends AbstractDbMapper { //... ...
0
votes
1answer
18 views

How to use zend_db_select to update when there is two clause

I want to update an entry in the table when 2 conditions are met. I have this statement, but it is only for one where condition $this->dbo->update('mytable', $data, ...
0
votes
1answer
46 views

use zend db with whare and orwhere when orwhere are in ()

hi i want create this sql in zend framework dbclass selec * from table where type = 2 AND (name LIKE '%4%' OR name LIKE '%5%') how i can do this with zend where and orwhere? using normal mode ...
0
votes
1answer
46 views

Zend Framework 2: Getting an ordered SQL call

I've been trying to get an order ASC/DESC call for a field (let's say craeted), and I can't seem to figure out how to do it in ZF2. Where am I going wrong..? namespace Todo\Model; class TodoTable ...
0
votes
3answers
76 views

How to log database errors in zend framework

I am using zend framework 1.12 for my project. I want to catch all types of fatal errors and send them to an email address for quick fix. I have written the below mentioned code in Bootstrap.php file ...
0
votes
0answers
43 views

How to use Zend_Validate twice

I'm using Zend_Validate_Db_NoRecordExists and I would like to validate my Zend_Form against two fields in DB, sample code: $phone_1 = new Zend_Form_Element_Text('phone_1'); ...
0
votes
1answer
42 views

Update multiple row in Zend

I am trying to figure out how to update multiple row in one update() in zend framework. I have an array of IDs named ids and I would like to update one field of all the rows of these ids. I tried to ...
1
vote
0answers
54 views

Working with Zend_Queue 1.12

Hi I am working with Zend Framework 1.12.0 I found this version of zend supports Zend_Queue. So I tried to test a sample of queue which was provided in Zend Doc Ref:1 ...
0
votes
1answer
41 views

Zend_DB subselect / subquery how to?

I have this raw sql statement which I am trying to execute through Zend_DB. $sql = 'SELECT relocationaction.id, relocationaction.vehicle, relocationaction.start, relocationaction.end, ...
0
votes
0answers
21 views

Zend DB + HTML inside Where

I have some problem with a query, i research across the internet and i couldn't found the answer. I have the following query Zend_Db_Table_Abstract $traits = $this->select() ...
0
votes
0answers
33 views

Zend is adding an extra column to my db2 select statement

I am working on a complex db2 select query, at least it is complex for me. Here is the query as it is coded in Zend(I am using Zend 1.11): $subQry5 = $this->select() ...
2
votes
2answers
169 views

Mysql rand() function in Zend framework 2

In zend framework 1, we had used mysql rand() function like below or using zend_db_expr(). I have tried this in ZF2, but this is not working. Somebody please help me to use this in Zend Framework 2 ...
2
votes
0answers
59 views

How can I turn ZF ->joinLeft()s into a Subquery?

How would i convert below query to sub query? I don't want to use JOINS I want to do same through sub query. i-e I need three subqueries out of the three joins. How it would be possible for below ...
0
votes
1answer
36 views

Parameterizing MySQL queries IN clause

I am using Zend's convenience methods for DB calls fetchAll. This, as the knowledgeable ones should know is a function that allows parameterization of queries. For instance, the query could be: ...
2
votes
1answer
37 views

PHP Zend_Db_Statement_DB2 returns null for static field

I am building my SQL statement through a PHP API, and then passing it through a module that connects to our database (DB2). My issue: a static field (sales_type) is returning null when passing the ...
0
votes
1answer
87 views

Missing /Zend/Db/Adapter/Pdo/Mysql.php

So after some long struggling I finaly have the ZendFramework running. Now I'm trying to get it working with my database, but my error file is telling me the following: PHP Warning: ...
0
votes
1answer
85 views

Add Coun Expression in Join to Magento Collection

Hi guys I'm having a hard time adding a join in Magento, well I know I can do $collection->getSelect()->join but I need to add a Count() expression in it. What I'm concretly trying to achieve ...
0
votes
1answer
51 views

Saving Model to multiple tables

maybe on of you can help my with a little problem im dealing with right now. I have a simple form with: Loginname, Loginpassword, Name, Firstname, Age. Now i want to save these information in two ...
0
votes
1answer
15 views

Accessing remote server using Zend_Db_Table

My current system is using Zend Framework 1, and works very well with our local MySQL server. However, I now need to access another server for importing/exporting. I'm using a class extended from ...
1
vote
2answers
106 views

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 ...
1
vote
1answer
108 views

How to set sql_mode in Zend Framework 2?

I'm currently having an issue with pagination in Zend Framework 2. This code public function findAllByCriteria(CourseSearchInput $input) { $concatDelimiter = self::CONCAT_DELIMITER; $select ...
0
votes
1answer
284 views

ZF2 + Zend\Db\Sql\Insert + ON DUPLICATE KEY UPDATE

I would like to insert some data using Zend\Db\Sql\Insert with the option ON DUPLICATE KEY UPDATE Actually I use this kind of query: INSERT INTO `user_data` (`user_id`, `category`, `value`) VALUES ...

1 2 3 4 5 17