Questions tagged [zend-db]

Database access component for the Zend Framework.

for PHP 5 includes a database access component, referred to as Zend\Db.

The Zend\Db component includes features such as:

  • Database connection factory class.
  • Adapter for multiple brands of database, closely matching the interface, and also supporting other non-PDO database interfaces such as mysqli and oci.
  • Simple query builder for generic SELECT syntax.
  • statement profiler and logger.
  • Table Data Gateway and Row Data Gateway classes. Together these are similar to the popular Active Record pattern.

Resources:

  1. Github repository
1092 questions
5
votes
3 answers

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 t2.rn, t2.item_id FROM t t1 JOIN t t2 ON (t2.rn >…
Capitaine
  • 1,923
  • 6
  • 27
  • 46
5
votes
2 answers

OR clause in Zend DB update?

I'd like to do a Zend db update with an OR clause. What would be the equivalent statement to: UPDATE mail SET message_read = 1 WHERE id = 5 OR id = 10
joeschmidt45
  • 1,932
  • 2
  • 17
  • 20
5
votes
1 answer

Tool That Convert mySQL Query To Zend FrameWork Query

Is there any Online Web Tool that Convert mySQL Query To Zend FrameWork Query. that is i type mySql Query and the Tool Convert it to Zend FrameWork equivalent Query
Edward Maya
  • 429
  • 2
  • 10
  • 25
4
votes
1 answer

update query in Zend Framework

what wrong with this Query ??? i need this Query. UPDATE user_preferences SET user_preferences_value = '2' WHERE user_preferences_name = 'is_user_package_active' AND user_id = '$user_id' AND phone_service_id='$phone_service_id'; is above…
Edward Maya
  • 429
  • 2
  • 10
  • 25
4
votes
3 answers

'PDOException' with message 'SQLSTATE[HY000] [2002] zend framework

Any one plz tell me why i am getting this error ?? firstly my internet connection was good today its not good so i am getting this error.how can i fix this any idea plz?? Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]…
Edward Maya
  • 429
  • 2
  • 10
  • 25
4
votes
1 answer

Zend_Db_Table insert issue with large content

I've been using Zend Framework for quite a while now, but now I have an issue that's got me puzzled. I have a table (MySQL) with just 2 columns (id and msg). The id field is an auto increment value and the msg field is a longtext type. The following…
vinnie
  • 41
  • 1
4
votes
2 answers

How to find all dates between two dates in Zend Framework Query

I need to find all dates between two dates; that is start date and end date. Here is my query but it is not doing what I need it to do. In my table I have column name date_created which is in format like this 2011-06-09 06:41:10. I want to remove…
Fawad Ghafoor
  • 6,039
  • 7
  • 41
  • 53
4
votes
2 answers

Zend_db caching

Is there a way to caching resultsets in Zend_db? For example, I want to run a select query using Zend_db and want this query to be cached to be able to run it faster later.
Cagatay Gurturk
  • 7,186
  • 3
  • 34
  • 44
4
votes
2 answers

joinLeft Zend Framework, the same field names in different tables

I've got a problem. I'm trying to left join two tables with Zend Framework using $select object. Unfortunatly my tables has common field 'name' and when I'm joining one with the other the results I get is that name field from table overwrites the…
Ertai
  • 1,735
  • 2
  • 23
  • 29
4
votes
3 answers

TCPDF - How to make the printing faster? It is very very slow, 1320 records took 40 minutes

Using Zend framework and TCPDF this is taking 40 minutes to print the Test.pdf. I having now no idea how to reduce this abnormal time to something normal? set_time_limit(0); $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true,…
user285594
4
votes
2 answers

Zend_Validate_Db_RecordExists with Doctrine 2?

I'm using Doctrine 2 in a Zend Framework application and require functionality similar to Zend_Validate_Db_RecordExists and Zend_Validate_Db_NoRecordExists. For example, when a user enters a new item, I need to validate that a duplicate entry…
cantera
  • 24,479
  • 25
  • 95
  • 138
4
votes
1 answer

Zend find ALL dependent rows

Given example: "table->person" - "table->books"(uses->person_id) - "table->notebook"(uses->person_id) In my Zend classes i define all relations from person to books and notebook and reverse. Now obviously if i want to delete that person, my…
Sam
  • 16,435
  • 6
  • 55
  • 89
4
votes
1 answer

Zend_Db_Table_Row: Why do I have to use createRow()?

I'm wondering why in Zend_Db you have to use the createRow method to get a new, empty Row object, rather than just instantiating the Row object directly. For instance, if I've extended the default classes to create my own User table and row classes,…
Brian Lacy
  • 18,785
  • 10
  • 55
  • 73
4
votes
3 answers

Inserting current date to MySql using Zend Date

I have a website based on Zend Framework. There is a form for users to fill in and the entered data is inserted in the database. The users don't enter the date/time. I would like to populate the data value based on the current date/time . The date…
user949852
  • 57
  • 1
  • 1
  • 7
4
votes
1 answer

Recommended Practice with Zend Framework's DB components?

Here's a bit of context first: I am writing a project in PHP using Zend Framework and I have some E/R diagrams from past meetings with the client. The database schema was written for MySQL and now it is time to implement my models in Zend. I am…
alxbl
  • 790
  • 4
  • 14