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

How can disable quote join Zend db

I've sql query select * from table1 left join (values (4),(1800),(103500)) AS "filter (id) on table1.id=filter.id By default Zend_Db_Select table quoted. For example: $result = '(values (4),(1800),(103500)) AS filter…
gregman
  • 332
  • 1
  • 11
0
votes
1 answer

mysql Error Code : 1052 with Zend_Db

i have 2 tables that are 1 = "issue_history" 2 = "issue_history_status" "issue_history_id" is column name which is in both tables. PK in "issue_history" & FK in "issue_history_status" this is my query $sql = $this->_db->select() …
Fawad Ghafoor
  • 6,039
  • 7
  • 41
  • 53
0
votes
1 answer

how can i fetch a column without table name associated with it in Zend framework?

i am unable to separte the table with the field from the below query. every query becomes table_name.field_name but i want only field_name as i want to output dummy string from the sql but i am unable to achieve this $select1 = $dbAdapter->select() …
Ankit Sharma
  • 143
  • 1
  • 10
0
votes
1 answer

Query 2 tables with one field linked to 2 different values

I'm trying to make a SQL query and I have some problems with it. CREATE table entries ( id_entry INT PRIMARY KEY, ); CREATE table entry_date ( entry_date_id INT PRIMARY KEY, entry_id INT, entry_price INT, entry_date TEXT, ); for each…
Jay Zus
  • 573
  • 5
  • 19
0
votes
1 answer

Issue in the Mapper Code in Zend Frame Work

Notice: Undefined variable: entryMessage in /var/www/Employee/application/models/EmployeeMapper.php on line 34 Fatal error: Call to a member function setEmployeeId() on a non-object in /var/www/Employee/application/models/EmployeeMapper.php on line…
0
votes
1 answer

(Why) Is Zend\Db\ResultSet a TableGateway Feature?

The Zend Framework 2 documentation for the Zend\Db\TableGateway\TableGateway says, that: The [Zend\Db\TableGateway\TableGateway] constructor can take Features in 3 different forms: as a single feature object, as a FeatureSet object, or as an array…
automatix
  • 14,018
  • 26
  • 105
  • 230
0
votes
1 answer

Zend_Db_Adapter_Sqlsrv insert date sql server 2008

I'm connecting to SQL Server using the Zend_Db_Adapter_Sqlsrv via SQL Server driver for PHP Wondering how I can insert a date which is read in from a web form in format dd/mm/yyyy into a datetime column Thanks in advance
db83
  • 169
  • 1
  • 4
  • 13
0
votes
2 answers

How to simulate "not in" with a join in Zend framework?

I have two relation table "demande" and "reponse" which are linked and I'd like to retrieve all the lines of "demande" not in "reponse". I try this with a join : $select = new Select (); $select->columns(array("id")); $select->from ("demande"…
Emmanuel Gauthier
  • 531
  • 2
  • 4
  • 15
0
votes
1 answer

Zend Db update and delete method and quoting

In documenation in Since the table update() method proxies to the database adapter update() method, the second argument can be an array of SQL expressions. The expressions are combined as Boolean terms using an AND operator. Note: The values and…
PaulP
  • 1,925
  • 2
  • 20
  • 25
0
votes
2 answers

Saving row after populating from Array - Zend

Once again a Zend Framework question! Any help is appreciated. I have a DB table class which i want to use to insert/update rows when a form is posted, and i would like to use the save() method so it can all go through the same method. //Users Db…
Stuart
  • 3,258
  • 4
  • 29
  • 39
0
votes
1 answer

How to get specific column only from related table?

I have query: $sql = new Sql($this->tableGateway->getAdapter()); $select = $sql->select(); $select->from('table_1') ->join('table_2', 'table_2_se_id = table_2.se_id and table_2_table_3_id = table_2.table_3_id', …
Nips
  • 13,162
  • 23
  • 65
  • 103
0
votes
1 answer

SetIntegrityCheck from DB Adapter in Zend

Hi there I want to use join in zend db select. I know that setintegritycheck() is importants in joins. I know how to implement it when I am having a model object like $select =…
Awais Qarni
  • 17,492
  • 24
  • 75
  • 137
0
votes
1 answer

zend : init() not getting called when i am writting __constructor() in my model class

I have written init() function in my db model class and i am using multi db zend functionality. in my init() i am fetching my db adapters and then my default adapter gets set as a default adapter and everything works fine. More than that i am doing…
Jimit Shah
  • 92
  • 1
  • 10
0
votes
1 answer

Zend_Form display forms from DB table rows

I'd like to build a dynamic FORM according to DB Table records. It'a room reservation module. Hotel has several room types with descriptions. When booking a hotel user should see form like: -- firstname [text-input] -- lastname [text-input] …
mrGott
  • 1,066
  • 3
  • 18
  • 53
0
votes
2 answers

Select Zend Db with array

What's the correct syntax to select multiple rows through an array using Zend ? So basically fetch all the data that has name $a OR $b etc..depending on number of array elements. I can't figure it out....... public function selectRow($array) { …
michael liu
  • 55
  • 1
  • 7