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

ZendFramework - Why is $this->fetchRow() failing?

Why this database query failing? in my CentOS. Error/Exception: "Notice: Undefined variable: table in /var/www/html/-manager/application/controllers/IndexController.php on line 37 Fatal error: Call to a member function getAdapter() on a non-object…
user285594
0
votes
2 answers

Join one resultset with another table zf2

I did following function and it's working fine. public function getLatestCurrencyRates(){ $sql = new Sql($this->adapter); $subselect2 = $sql->select(); $subselect2->from(array('r1' =>'currency_rates')) …
cha
  • 730
  • 2
  • 12
  • 28
0
votes
1 answer

zend_db obtain "select ..., (select ...) as x from ... "

I have a query that i can't build with Zend_Db_Select SELECT `f`.*, (SELECT Sum(x) AS `y` FROM z AS pf WHERE pf.q_id = f.id) AS w FROM f ... WHERE ... GROUP BY `f`.`id` so at the moment i'm running it…
max4ever
  • 11,909
  • 13
  • 77
  • 115
0
votes
2 answers

Getting require_once in Zend to find files

I am new to ZEnd, any help is greatly appreciated I had various contractors work on my site, and things got a messy, with multiple copies of the same folders in different locations. Now I am going in and trying to clean things up. FUN!!! One of the…
0
votes
1 answer

Zend Database, Join Query with Typecast error (I think)

Im wondering if there is some means of just plopping a prepaired statement into the Zend Database class, and using that rather then using ->select(), ->from(), ->where(). I have tried the below query in just ->query() but that fails to. I only ask…
chris
  • 36,115
  • 52
  • 143
  • 252
0
votes
2 answers

Is it possible to profile Zend_Table queries?

I'm looking for a way to profile queries which are performed internally by Zend_Table. For example, after you finish Quickstart course, how to profile all the queries that are performed ? I've tried to enable profiler from application.ini like this:…
Vitalii Lebediev
  • 632
  • 2
  • 10
  • 19
0
votes
1 answer

How to show data in different sequence in database in zend framework?

I am using datatables to list my data. It showing my data in the same sequence as it is in database tables . But I want to show it in a different sequence. My code: $userData = array(); $row = array(); $action = array(); foreach ($students as $key…
user1559230
  • 2,790
  • 5
  • 26
  • 32
0
votes
2 answers

In Zend_Auth, can I get a domain-model User object instead of stdClass?

While working on the login part of an application, I find myself running into an issue: My model is based on Active Record, by extending Zend_Db_Table_Row objects. Whenever I have to deal with a user, I'd want to do this through the User object…
kander
  • 4,226
  • 1
  • 22
  • 43
0
votes
1 answer

Sum of SQL fields in PHP

Hi I'm trying to find the sum of SQL fields in PHP. This sum must be less than or equal to the number which I receive in controller from JavaScript. But my SQL syntax is not working in PHP, instead it fetches all rows from the…
Indira
  • 49
  • 6
0
votes
1 answer

use part of string in query

i have a mysql table with date of birth, so an example field would be: dob ---- 1989-01-01 I have pulled todays date in zend framework with the following code: public function todaysDate() { $date = new Zend_Date(); $date =…
RSM
  • 14,540
  • 34
  • 97
  • 144
0
votes
1 answer

Zend Queue DB Exception

I'm using Zend_Queue with the DB adapter outside the framework, I have the following code:
neilcrookes
  • 4,203
  • 2
  • 21
  • 27
0
votes
1 answer

Set a value to null, when calling Zend_Db::update() and insert()

My question is the exact same as How to Set a Value to NULL when using Zend_Db However, the solution given in that question is not working for me. My code looks like the following. I call updateOper on the Model class when update is clicked on the…
user_stackoverflow
  • 734
  • 2
  • 10
  • 18
0
votes
1 answer

Menu and all pages content from database

I'm writing simple website with some cms functions. It would be good to have all menu items and pages contents held in database. I have table with id, name, parent_id and a content field. In future I would maybe move content to a content table to…
masteryoda
  • 272
  • 2
  • 20
0
votes
1 answer

Notice: undefined index 'itemid' in foreach construct

I am new to PHP and Zend Framework. I met the error: Notice: Undefined index: itemid in C:\xampp\htdocs\blogshop\application\views\scripts\item\tops.phtml on line 58 I don't get why this error shows up. public function topsAction() //tops…
0
votes
2 answers

How to manage huge DB tables to minimize fetching time in MySql

I have a huge Database table containing around 5 Million rows. Now retrieving records make the server slow in some cases. How can i manage the table now as it growing over the days. I was thinking to make some archiving technique on yearly basis for…
Suleman Siddiqui
  • 411
  • 2
  • 5
  • 16