Questions tagged [zend-db-table]

Object-oriented interface to database tables

The Zend_Db_Table class is an object-oriented interface to database tables. It provides methods for many common operations on tables. The base class is extensible, so you can add custom logic.

The Zend_Db_Table solution is an implementation of the Table Data Gateway pattern. The solution also includes a class that implements the Row Data Gateway pattern.

Official documentation

437 questions
0
votes
1 answer

How to return all rows, even if they don't have rows in a joined table

I have three tables, Users, Profiles and Requests. Only users that have created requests, will have a row in the requests table. But I still need to get all the users back and display the total number of requests, per user. I have worked out the…
Carl Weis
  • 79
  • 7
0
votes
1 answer

Zend Framework error [database connection]

Today trying to run my project coded under Zend Framework, and connected to a remote database, i got those 2 errors: PDOException: SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period…
Ahmadhc
  • 173
  • 1
  • 13
0
votes
1 answer

Zend Framework - No update() at all

I just want to update a column of type text and set it to empty, but the Apache error log says: PHP Catchable fatal error: Argument 2 passed to Zend_Db_Adapter_Abstract::update(), here's the code: public function setDbTable($dbTable) { if…
ThreeCheeseHigh
  • 1,429
  • 5
  • 22
  • 40
0
votes
1 answer

Write an sql Query in Zend

As a beginner in zend Framework i need some help to write an sql query. This is my Query: SELECT COUNT( * ) AS Ouvert , SUBSTRING_INDEX( emails.email_value, '@', -1 ) AS FAI, track_open.open_date FROM emails, track_open WHERE…
Ahmadhc
  • 173
  • 1
  • 13
0
votes
2 answers

Zend2 TableGateway: how to retrieve a set of data

I have a ContactsTable.php module and an function like this: public function getContactsByLastName($last_name){ $rowset = $this->tableGateway->select(array('last_name' => $last_name)); $row = $rowset->current(); if (!$row) { …
0
votes
3 answers

How to optimize mysql full match

Hey guys, do you know some trick about how can I optimize more a full match search? The code that I'm trying to optimize: $do = $this->select() ->where('MATCH(`name`,`ort`) AGAINST( ? IN BOOLEAN MODE)', $theString) ->order('premium…
Uffo
  • 9,628
  • 24
  • 90
  • 154
0
votes
1 answer

Sql query in Zend Syntax

How to make this work in Zend... select name, comment_id, text, date, number from user, comment, telephone where user.user_id = comment.user_id and telephone.telephone_id = comment.telephone_id and telephone.number = 000; Thank you
Marcin
  • 173
  • 12
0
votes
0 answers

Categories and subcategories listing and cycle in Zend Framework

I have the following categories table: ID | Category Name | Date Added | Parent ______________________________________________________________________ 1 | 'Countries' | '2013-10-09 04:18:09' | 0 2 | …
Tudor Ravoiu
  • 2,130
  • 8
  • 35
  • 56
0
votes
3 answers

Zend Framework: select distinct rows by two fields

I have in a dbtable field 1 field 2 1 2 2 3 2 3 2 2 1 1 2 2 I want to get field 1 field 2 1 2 2 3 2 2 1 1 Tried $select =…
user1890184
  • 49
  • 2
  • 10
0
votes
1 answer

Zend_Db_Table_Select_Exception

Recieved this error from the below method? 2013-10-02T14:20:05+01:00 ERR (3): exception 'Zend_Db_Table_Select_Exception' with message 'Select query cannot join with another table' in /usr/share/php/Zend/Db/Table/Select.php:215 class…
Kal
  • 2,239
  • 6
  • 36
  • 74
0
votes
1 answer

Zend DbTable add where in if() statement

I get my data by this way: $table = new Application_Model_DbTable_FooBar(); $data = $table ->select() ->where('id = ?', (int) $id) ->query() ->fetchAll(); and want to add a separate where clause in an if() statement. Something like that: if($foo…
Mischa
  • 1,073
  • 2
  • 13
  • 23
0
votes
1 answer

in the same query where and like zend framework 2

Where to make a query like this, how can I do? SELECT * FROM hotels WHERE name LIKE '%mykey%' AND country_id = '12' I have done so, but we must not: $select = $this->sql->select(); $select->from(self::TABLE); if ($params['key']) { …
0
votes
1 answer

How to load point data into zend_db_row classes?

I have following classes My_Table extends Zend_Db_Table_Abstract My_Row extends Zend_Db_Table_Row_Abstract I my table has a column of the type Point var_dump($row->point); string(25) "= ףp@@= ףp�^@" How can I fetch the point column as text…
Moak
  • 12,596
  • 27
  • 111
  • 166
0
votes
1 answer

Zend Model Mapper fetchAll() ignores my WHERE clause

In this code : class IndexController extends Zend_Controller_Action { public function init() { /* Initialize action controller here */ } public function indexAction() { $records = new…
ryancey
  • 1,037
  • 2
  • 11
  • 27
0
votes
1 answer

zend dynamic creating and using tables

I need to automatically create tables with same structure each month and use a newest one but old tables should be readable. I think to make a table witch will contain names of this tables but how can I use in Zend_Db_Table_Abstract protected $_name…
user1927652
  • 91
  • 1
  • 5