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

Zend_DB whats the right strategy to export large amounts of data to csv? – chunks – fetchAll – fetchRow

I have to export a huge amount of data. Also I have to transform every record a little bit through php. Whats the right strategy to export large amounts of data? Do I split Zend_Db requests in multiple chunked queries with limit(1000,x)? Do I use…
Manuel
  • 9,112
  • 13
  • 70
  • 110
0
votes
1 answer

how to store different db connections

I am trying to store a db connection from a crontoller and trying to use it in a different mapper class using zend registry. I cannot figure out how and I am running into problems. indexcontroller.php public function indexAction() { // action…
shorif2000
  • 2,582
  • 12
  • 65
  • 137
0
votes
1 answer

How to clean up referenced files after a cascaded delete in an RDMS?

Zend_Db contains methods to cascade deletes and updates much like the way that most RDMS's will. The documentation states that if you are using a RDMS which supports forign keys that you should use that in place of the support in Zend_Db. The…
user999305
  • 1,013
  • 10
  • 15
0
votes
0 answers

zend multidb for sqlite

I am trying to set up multidb. The multiple datatbase connections will be coming dynamically entered by users using a form. bootstrap.php private $_session = null; public function init() { Zend_Session::start(); …
shorif2000
  • 2,582
  • 12
  • 65
  • 137
0
votes
2 answers

Zend_db_Select multiple where but with variable clauses possible?

Is it possible to dynamically create a select statement with multiple where() clauses? Suppose a function that takes multiple arguments. If the Nth argument is non-empty, add a ->where('sth = ?", $value) clause in the statement and do that for all…
johnjohn
  • 4,221
  • 7
  • 36
  • 46
0
votes
1 answer

Zend Framework: Escaping form input using setFromArray()

I've been looking at increasing security and stability across some of my websites and one thing I've been checking is escaping all input from users (as I should be doing). In a lot of cases, I'm using the standard Zend_Db_Table_Row setFromArray()…
dKen
  • 3,078
  • 1
  • 28
  • 37
0
votes
2 answers

Zend_DB_Select - How to write this SQL Statement

Good Morning, i have some Trouble with the Zend Framework and Zend_DB_Select, i want to use this (Working) SQL Statement as Zend DB Select Statement : select oslang from oslang, os where oslang.oslang_id = os.oslang_id and ossubversion_id =…
opHASnoNAME
  • 20,224
  • 26
  • 98
  • 143
0
votes
2 answers

How to Convert Zend_Db_Rable_Row to object

How to Convert Zend_Db_Rable_Row to object. Assume the database table has same column names as the variables in the object except the '' (private variables in the object are starting with '' (underscore)) for example database table column is…
Sachindra
  • 2,052
  • 4
  • 23
  • 29
0
votes
2 answers

Getting column values as array, Zend_Db, Mysql, php

I have the following database tables: table: person Columns: id, first_name, age, city, state table: study Columns: id, name, description, notes table: person_studies Columns: person_id, study_id, notes I need to get all the study names that a…
user_stackoverflow
  • 734
  • 2
  • 10
  • 18
0
votes
1 answer

Zend PHP - sqlsrv insert and Select_Scope() with fetchOne

I am creating a website using PHP and Zend Framework. I am uisng the sqlsrv adaptor to talk to my database. I am trying to write an insert query and also store the ID of the new row. I have written an SQL query like this: $db =…
Random Developer
  • 175
  • 5
  • 17
0
votes
2 answers

retrieve last updated column in mysql

I have a MySQL query that goes as follows (using Zend_Db): $sql = $handle->quoteInto("UPDATE board SET rank=rank+1 WHERE post_id=?", $postid); $handle->query($sql); (Rank isn't an auto-incrementing PK). I would like to now retrieve the value of…
adamcroft
0
votes
2 answers

Inner joins with zend models

Having problems with this script: $select = $tabela->select() ->joinInner('pedidos_itens', 'pedidos.peIp = pedidos_itens.ipPedido', array('ipProduto', 'ipQtde', 'ipCor', 'ipTextura', 'ipTamanho', 'ipSeq')) …
JLFerrari
  • 155
  • 3
  • 16
0
votes
2 answers

Stop quotes from being escaped in zend where

I have simple table of hashes with 3 columns . Id is an email address. Now, I want to retrieve the hash given id and type. I do this: $select = $this->getDbTable()->select(); $select->where('id=?', $id)->where('type=?', $type); And I get SELECT…
crazyphoton
  • 623
  • 5
  • 20
0
votes
1 answer

Zend: Can't populate() select element from DB for update

I have some problems to find the solution by myself, that's why I ask the community. I am developping an app with Zend Framework. I have a form, with some SELECT Elements. Some of them are populated with data from the DB, and some others with data…
JuJ
  • 3
  • 3
0
votes
2 answers

Setting-up Application.ini in Zend Framework for Model

I'm new to Zend Framework. I've been following book "ZendFramework - A Beginners Guide". in the 4th chapter, they start using Doctrine. The thing is that I'd like to use Zend's built-in functionality with database interactions. I've searched the web…
mrGott
  • 1,066
  • 3
  • 18
  • 53