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
2
votes
3 answers

Zend Framework: How to include an OR statement in an SQL fetchAll()

I am trying to build the following SQL statement: SELECT `users_table`.*, `users_data`.`first_name`, `users_data`.`last_name` FROM `users_table` INNER JOIN `users_data` ON users_table.id = user_id WHERE (users_table.username LIKE '%sc%') OR…
Scoobler
  • 9,696
  • 4
  • 36
  • 51
2
votes
1 answer

Zend Framework how to map DbTable model to database table and insert new row

I cannot figure out how to correctly map a DbTable model to a database row in a table in my DB and correspondingly extend this DbTable model to another model so that I can insert a new row. Any simple examples and explanation would be very helpful,…
Justin
  • 105
  • 2
  • 8
2
votes
1 answer

Zend_Db_Table Using different Connection-Adapter for reading and writing

In a current ZF project i have to use diffrent DB Connections for reading and writing. My approuch was do this by extending Zend_Db_Table_Abstract (and Zend_Db_Table_Row_Abstract) It looks like this at the moment: class SomeNamespace_Db_Table…
Rufinus
  • 29,200
  • 6
  • 68
  • 84
2
votes
1 answer

How to use bind variables with Zend_Db_Table->update() in the where clause

If I want to use the Zend_Db_Table->update() method to update my table with data, I cannot find anyway to use bind variables in the "where" clause. The method signature is: int update($data, array|string $where) Usually you will call the method…
asgeo1
  • 9,028
  • 6
  • 63
  • 85
2
votes
1 answer

No adapter for type Zend_Db_Table_Row error?

I have a project in which I use more than one adapter. So In ma models i created an abstract model abstract My_Config1_Model extends Zend_Db_Table_Abstract { public function init() { $db =…
Granit
  • 931
  • 3
  • 12
  • 22
2
votes
2 answers

Zend Framework relationships - defining column names in findManyToManyRowset()?

I'm working on an application developed using Zend Framework. I have defined relationships in models, and can use them happily, e.g: $rowset = $row->findManyToManyRowset('People', 'Jobs'); However, i've hit a problem where the rowset is returned…
fistameeny
  • 1,048
  • 2
  • 14
  • 27
2
votes
2 answers

zend framework 2 autentification using DbTable failure

I have followed the zend instructions for implement my web Authentication using a database table. It's exactly the same code, but when render the page, the following exceptions appears: Zend\Authentication\Adapter\Exception\RuntimeException …
josepmra
  • 617
  • 9
  • 25
2
votes
2 answers

using zend test dbadapter with zend db table abstract

Has anyone been able to to use Zend_Test_DbAdapter with Zend_Db_Table_Abstract? I'm trying to test a Model I created that extends Zend_Db_Table_Abstract and I get an exception regarding the primary key not being set if I use a Zend_Test_DbAdapter…
2
votes
3 answers

Zend Framework and Mysql - very slow

I am creating a web site using php, mysql and zend framework. When I try to run any sql query, page generation jumps to around 0.5 seconds. That's too high. If i turn of sql, page generation is 0.001. The amount of queries I run, doesn't really…
iBiryukov
  • 1,730
  • 4
  • 19
  • 30
2
votes
3 answers

How to use Data Tables and Data Mappers? Are they necessary?

I have had experience with frameworks before, but never really got into models much. I don't know if this is the case for all frameworks or just zend, but currently I am learning Zend Framework. I have been crawling through sample applications and…
Ilyas Serter
  • 810
  • 1
  • 8
  • 12
2
votes
4 answers

MySQL random rows sorted by a column name

Original Question: I am currently using Zend Framework with Zend_Db_*, and I am selecting three random rows from a table: $category->getTable()->select()->order(new Zend_Db_Expr('RAND()'))->limit('3') Where $category is a Zend_Db_Table_Row. I would…
X-Istence
  • 16,324
  • 6
  • 57
  • 74
2
votes
1 answer

Zend_Db_Table Select missing data, straight PHP query ok

I am converting a php app to zend framework and utilizing Zend_Db_Table to make my queries. My problem is that after converting to zend format, my expected result for a text format field returns an empty string instead of the stored data. A records…
steve
  • 1,786
  • 1
  • 15
  • 29
1
vote
2 answers

Cannot seem to get Zend Framework to work with two mysql databases

I am trying to connect to two databases with Zend Framework. How ever it is throwing me the following error #0 C:\xampp\php\zf\library\Zend\Db\Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array) #1…
JoeyD473
  • 2,890
  • 2
  • 21
  • 25
1
vote
1 answer

Trying to get property of non-object in Zend Framework 1.11 Application

I'm trying to create a table of information in a database query using Zend Framework 1.11, Zend_Db, and Zend_Db_Select. Initially, I went about this by instantiating a new instance of my table and using $table->select(). However, when I went to JOIN…
jflores
  • 483
  • 6
  • 18
1
vote
3 answers

Zend DB - Count(*) not working

My sql statement is not working with Zend, its complaining about the Count(*) field... what am I doing wrong? // get open/closed $stmt = $db->query('SELECT status, count(*) as total FROM reported_issues WHERE date_reported >= '.$today.' AND status…
Kladskull
  • 10,332
  • 20
  • 69
  • 111