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

exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'order_increment_id' in 'where clause'

I am experiencing errors in magento ever since I upgraded from 1.6.2 to 1.7. I am not as familiar with Zend DB calls and I have not been able to figure out these errors. 2013-09-11T15:52:15+00:00 ERR (3): exception 'PDOException' with message…
user2800261
  • 1
  • 1
  • 1
0
votes
1 answer

Zend Framework: Error in my database query syntax, please help!

I keep getting this error in my application and can't figure out what it means and where it's happening. I know it's in one of my models but I don't understand the error. SQLSTATE[HY093]: Invalid parameter number: no parameters were bound Have you…
Andrew
  • 227,796
  • 193
  • 515
  • 708
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

automatically create db in Zend

I was wondering if Zend has any way to automatically construct a database from model declarations. I could not find any documentation on the matter. I'm talking now from the point of view of someone who has experience in Python, where both Django…
Bogdan
  • 8,017
  • 6
  • 48
  • 64
0
votes
1 answer

Zendframework Union Issue

I have this code running $sq = $this->_codes->getAdapter()->select() ->from (array('cs' => 'code_statuses'), array('total' => 'count(*)')) ->join ( array ('c' => 'codes'), 'c.code_id = cs.code_id', …
0
votes
2 answers

What is the most suitable way to work with databases in Zend Framework?

I'm developing web application with Zend Framework. In the documentation it says ... "Be aware though that the Table Data Gateway pattern can become limiting in larger systems." What are the drawbacks of using Table Data Gateway ? What is the…
ChamingaD
  • 2,908
  • 8
  • 35
  • 58
0
votes
1 answer

Cannot update specific existing column with value

I would like to increment an existing column in my usertable with a dynamic atttribute (karma points) function updateUserKarmaPoints($karmapoints,$userid){ $userkarmaptsarr = array('karmapoints' => new Zend_Db_Expr('karmapoints')+$karmapoints); …
Slay
  • 1,285
  • 4
  • 20
  • 44
0
votes
1 answer

How to make COUNT AS in Zend_Db_Select?

So I have this query: select u.*, count(mi.media_id) as media_count from user as u left join media_items as mi on mi.user_id = u.user_id where u.is_enabled = 1 and group by u.user_type having media_count > 0; I'm trying to translate it to a…
kailoon
  • 2,131
  • 1
  • 18
  • 33
0
votes
1 answer

Select all data and an expression with zend

I have a question regarding zend db. I would like to select all the data from a table + an expression such as a count. Unfortunately, when you pass an array with count in the select object, it will only select the count. As the table is really big,…
oveka
  • 57
  • 5
0
votes
1 answer

zend select from two tables 3 sets of rows

I have this problem using Zend and I think its db related at all: I have two tables, one contains: id, ..., file, desc, date and the second table contains: id, ..., file_1, desc_1, file_2, desc_2, date What I need as a result is: id, ..., file,…
Ziker
  • 141
  • 4
  • 20
0
votes
1 answer

Zend framework 1 empty array with db select

I have a problem, this is a part of my controller and it provides me with an empty array: $tifos = $model-> select()->setIntegrityCheck(false) -> from(array('t'=>'tifos'), array('*', 'date'=>'DATE(t.created_at)')) ->…
Ziker
  • 141
  • 4
  • 20
0
votes
1 answer

Update , Delete data from 2 table with one action zf2

i have 2 Table **Table sale :** id_sale int id_projet int price float date date **Table sale_ligne:** id_sale_ligne int id_sale int FK_SALE id_projet int price float date date i was able to…
Loouu
  • 19
  • 7
0
votes
1 answer

Error in zend_db_select statement to return as new column

I am trying the return with a new column named count. Here is my query. $userid is the paramter to pass in $select = $this->db->select() ->from('myfriend') ->where('fromid=?', $userid) ->join('user',…
Slay
  • 1,285
  • 4
  • 20
  • 44
0
votes
1 answer

Zend Framework 2 inserting into database works fine but still iam getting an error

Here is my model code below, public function insertme() { $sel = new Sql($this->adapter); $s = $sel->insert('users'); $data = array( 'fname'=>'fisdsds', 'lname'=>'sdsdsdme', 'email'=>'sdsdsds', …
Friend
  • 1,326
  • 11
  • 38
  • 62
0
votes
3 answers

How to load Zend 2 classes on autoloader

Previously, i am using zend 1.x. I am able to autoload zend classes using the below code. // autoload class from Zend Lib require_once ABSPATH.'/classes/Zend/Loader/Autoloader.php'; $loader = Zend_Loader_Autoloader::getInstance(); try{ //…
Slay
  • 1,285
  • 4
  • 20
  • 44