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

Prepared statement in Zend\Db\Sql not executing

I am experimenting with Zend\Db\Sql in zf2. I have some problems making a simple query. Below is my code. $id = 342; $select2 = $this->sql->select(); $select2->from('users'); $select2->where(array('fbid'=>$id)); $statement =…
Slay
  • 1,285
  • 4
  • 20
  • 44
0
votes
1 answer

Need help transforming Zend Db Select from zf1 to zf2

I am doing a update on my framework. Previously i am using zf1 zend db select for my data access object class. Now, i would like to make a shift and upgrade to zf2. I have problems translating for the insert, update, select, and delete queries and…
Slay
  • 1,285
  • 4
  • 20
  • 44
0
votes
1 answer

Simple Display Results from Database

I have set up correctly the parameters for Zend_Db::factory and then I am querying like: $select = $db->select() ->from('imdb') ->limit(10); $stmt = $db->query($select); $result = $stmt->fetchAll(); Question: Why I do not see anything displayed? I…
pancy1
  • 491
  • 7
  • 16
0
votes
1 answer

Get first UTF-8 char from string and save in DB

I have a problem with inserting a letter that is not an A-Z char. For example: $fullTag = 'świat'; A 'letter' should contains ś $data = array( 'full_tag' => $fullTag, 'count' => 1, 'letter' => $fullTag[0], ); But when I execute…
hsz
  • 148,279
  • 62
  • 259
  • 315
0
votes
1 answer

Write an sql Query in Zend

As a beginner in zend Framework i need some help to write an sql query. This is my Query: SELECT COUNT( * ) AS Ouvert , SUBSTRING_INDEX( emails.email_value, '@', -1 ) AS FAI, track_open.open_date FROM emails, track_open WHERE…
Ahmadhc
  • 173
  • 1
  • 13
0
votes
1 answer

PHP - Best Way To Handle Multiple database in Zend framework 2

We are creating a web application using Zend Framework 2 with multiple databases. I have a core database which loads info of all customers. This database contains customer table. The fields of customer table are…
Ujjwal Ojha
  • 1,340
  • 10
  • 17
0
votes
1 answer

ZF2 TableGateway repeating values when loading from csv file

First of all, sorry for bad english. I am trying to load several users from a csv list like this:
0
votes
2 answers

Zend2 TableGateway: how to retrieve a set of data

I have a ContactsTable.php module and an function like this: public function getContactsByLastName($last_name){ $rowset = $this->tableGateway->select(array('last_name' => $last_name)); $row = $rowset->current(); if (!$row) { …
0
votes
1 answer

Zend Framework, access denied to my database, but only under certain wi-fi connections?

This is the second time that I've noticed this... I am running my Zend Framework application on my laptop, but connecting to my remote database. It works fine most of the time (from home, and other places). But this is the second time that I get an…
Andrew
  • 227,796
  • 193
  • 515
  • 708
0
votes
0 answers

Categories and subcategories listing and cycle in Zend Framework

I have the following categories table: ID | Category Name | Date Added | Parent ______________________________________________________________________ 1 | 'Countries' | '2013-10-09 04:18:09' | 0 2 | …
Tudor Ravoiu
  • 2,130
  • 8
  • 35
  • 56
0
votes
1 answer

Zend_Db_Table_Select_Exception

Recieved this error from the below method? 2013-10-02T14:20:05+01:00 ERR (3): exception 'Zend_Db_Table_Select_Exception' with message 'Select query cannot join with another table' in /usr/share/php/Zend/Db/Table/Select.php:215 class…
Kal
  • 2,239
  • 6
  • 36
  • 74
0
votes
1 answer

Zend_Db_Table_Abstract and MySQL IN Keyword

Hey I have a query that uses the IN keyword. How can I translate this to the zend select query? This is the query in raw SQL form: SELECT rs_credit_score, rs_fraud_score FROM provenir_instance_response WHERE …
Kal
  • 2,239
  • 6
  • 36
  • 74
0
votes
1 answer

Querying two tables based on the results of one table - Zend 2

I am using TableGateways along with the Object Mapper which uses the exchangeArray() method for getting database results. This method is fine for getting data in one go. However, I am struggling to render a table of results where I want to get…
ryrobbo
  • 83
  • 1
  • 6
0
votes
1 answer

in the same query where and like zend framework 2

Where to make a query like this, how can I do? SELECT * FROM hotels WHERE name LIKE '%mykey%' AND country_id = '12' I have done so, but we must not: $select = $this->sql->select(); $select->from(self::TABLE); if ($params['key']) { …
0
votes
1 answer

How to load point data into zend_db_row classes?

I have following classes My_Table extends Zend_Db_Table_Abstract My_Row extends Zend_Db_Table_Row_Abstract I my table has a column of the type Point var_dump($row->point); string(25) "= ףp@@= ףp�^@" How can I fetch the point column as text…
Moak
  • 12,596
  • 27
  • 111
  • 166