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

How to get access to my data in the model?

i have some data in my database mysql, which i receive with query in my model $row = $this->fetchRow('id ='.$id); return $row; one of the column in my database table store date in timestamp format and i want to convert that with php function date…
socm_
  • 783
  • 11
  • 28
0
votes
1 answer

Exception information: Message: No adapter found for Model_Bug

I'll be honest, Zend is giving me a lot of headaches at the moment, but I guess we all have to start somewhere and I'm learning fast. I am using the Apress book 'Pro Zend Framework Techniques' to learn how to use Zend, but hit and error last night…
Daniel Groves
  • 472
  • 2
  • 8
  • 21
0
votes
0 answers

zend_translate with mysql database

currently i have an zend application with translation plugin as below class Zc_Controller_Plugin_LangSelector extends Zend_Controller_Plugin_Abstract { public function preDispatch(Zend_Controller_Request_Abstract $req) { $lang =…
d3bug3r
  • 2,492
  • 3
  • 34
  • 74
0
votes
1 answer

Including ZendX Jquery in bootstrap

How to add a ZendX Jquery library in zend bootstrap file ? my following code seems not working properly. protected function _initViewHelper() { $this->bootstrap('view'); $view = $this->getResource('view'); …
d3bug3r
  • 2,492
  • 3
  • 34
  • 74
0
votes
1 answer

Zend Framework - Issue with delete from database code

In my Application_Model_DbTable_User, I have the following function: public function deleteUser($username) { $this->delete('username = ' . (string) $username); } This function is being called from my AdminController, with this three lines of…
Ayrx
  • 2,092
  • 5
  • 26
  • 34
0
votes
1 answer

how does one describe/impolements contraints and tables relations in Zend_DB 2.0 (zf2 beta5) mappers classes

In zend_db 1.x we used reference_map to implements constaints and relations in the data mapper classes. In zend_db 2.0 where should the reference map go?
EddardOmeka
  • 795
  • 5
  • 11
0
votes
1 answer

Translating this sql statement to Zend_Db_Table

I have this test query that works fine: select `name` from `Role` as rl, `UserRole` as ur WHERE rl.id = ur.roleId AND ur.userId = '1' result: 'test' I 'm trying to use Zend_Table to do the same thing but I seem to be doing it wrong. Here 's what I…
johnjohn
  • 4,221
  • 7
  • 36
  • 46
0
votes
0 answers

retrieving a single value from database

I try to retrieve a single value from MySQL database, and I'm using Zend Framework. Here is a part of my application.ini which I use to store database information. [production] resources.db.adapter = PDO_MYSQL resources.db.params.host =…
PHP-Zend
  • 301
  • 1
  • 4
  • 20
0
votes
2 answers

Mysql complicated query with join and count to do same work as subquery and to use it in zend framework

I have a rather complicated query that I want to put into use with Zend Framework. In order to do this I needed to convert query from subqueries to joins. This is the deal: I have 3 tables that need to be connected in order to form proper info. This…
Johnny_Bit
  • 101
  • 1
0
votes
1 answer

Zend Framwork select() gives unexpected SQL

For my application I have a method in my Messages model which returns all the messages sent by the current user ($id). It returns information from 3 tables using 3 joins. As both the sender and the recipient come from the same 'users' table, I had…
Hans Kuit
  • 58
  • 3
0
votes
1 answer

Prepaired statements in Zend_Db insert query

I currently use Zend_Db to manage my queries $stmt = $db->prepare("INSERT INTO test (ID_Test) VALUES (:ID)"); $stmt->bindParam(':ID', 4, PDO::PARAM_INT); $stmt->execute(); But this does seem to work throwing an error "Fatal error: Cannot pass…
Reneshankar
  • 157
  • 2
  • 2
  • 8
0
votes
2 answers

Zend DB - where And Or Query

Could someone please tell me the correct syntax for a Zend DB query to represent the last line (the and (xxx or xxx) ... where id = 1241487470 and (contract=0 or is_work IS NOT NULL) ... I'm stuck at this: ->where('id = ?',…
Jarrod
  • 9,349
  • 5
  • 58
  • 73
0
votes
1 answer

MySQL or Zend sometimes returning nulls instead of numbers

For some reason, some of my SQL queries seem to be handling numbers oddly. For instance, in my mySQL database I have a table called users with an INT(11) field called points. When I try to retrieve this field, sometimes it returns correctly, and…
jaimerump
  • 882
  • 4
  • 17
  • 35
0
votes
1 answer

Complex Zend Query from same user table

I have a rather unique set of conditions and orders in which I need to retrieve data from a "sellers" table for an application I'm building in Zend framework. The client is basically requesting an application where the directory page lists sellers…
Brian Vanderbusch
  • 3,313
  • 5
  • 31
  • 43
0
votes
2 answers

how i can check is my database alive?

in my zf application i have base model class Application_Model, which connects to db and stores connection in registry. part of code: $db = Zend_Db::factory($registry['config']->$databaseAlias->db->adapter,…
aloneibreak
  • 335
  • 4
  • 16