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

Why Zend framework Db Table put an asterisk before the table name on my query?

I have a problem with a query like this: $sSqlAux = $this->select()->setIntegrityCheck(false) ->from(array("a_aux" => $this->_name), "id_a", $this->_schema) ->join(array("b_aux"=> "b"), "a_aux.id_a = b_aux.id_b", array(), $this->_schema) …
0
votes
1 answer

Zend DB - Max Time does not return the latest time

I have the follow table value with timestamp. [ttimestamp] column 2013-07-11 11:52:19 2013-07-11 11:52:23 2013-07-11 11:52:27 However, instead of return the latest time with the following query, it returns the smallest... Why? $select =…
Mouse Tan
  • 73
  • 5
0
votes
1 answer

Debugging Zend project

I have transferred a working zend project to another server. It is a main domain and everything is set up correctly (I think). Header and footer are working good but in the middle content area it displays error messages. Server IP:…
Vasanthan.R.P
  • 1,277
  • 1
  • 19
  • 46
0
votes
0 answers

Zend Php ORA-02391

I have an application made ​​in php with zend 1.12 where it connects to a production database oracle which has maximum 5 connections available today is showing me the error ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit, anyone know or…
nesX
  • 1
  • 1
0
votes
1 answer

Securing my zend_db_select insert statement

I am using zend_db_select class as my sql wrapper. I would like to know if the following insert statement is secured. (whether it provide mechanism to prevent sql injection etc) function createNew($message,$tags,$userid,$imgsrc){ $data =…
Slay
  • 1,285
  • 4
  • 20
  • 44
0
votes
1 answer

Zend_Framework 1.12 SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax

Before anything I am aware of the multiple questions asked concerning this exception. I have looked through them but have not found an answer for my particular problem. Most of the questions use the Zend_Db_Table::getDefaultAdapter(); , and I am not…
Chayemor
  • 3,577
  • 4
  • 31
  • 54
0
votes
1 answer

Zend/db/Sql/ query syntax

I am starting with Zend Framework 2 , I want to make a routing choice with the role of My user and I must write getRoleByID($id) , then How can'I write " Select 'role' from user where ('id' = $id) " with Zend\Db\Sql
Loouu
  • 19
  • 7
0
votes
2 answers

How can I improve the following mysql selects?

I am currently refactoring a legacy application and converting piece by piece over to zend framework 1.12. I am scratching my head as to how to convert this over to zend db, is there a way that this can be done in one query? Right now I see that it…
MikeGA
  • 1,262
  • 4
  • 17
  • 38
0
votes
2 answers

zend framework database connection not working

I am try to do database connection in zend framework Below is my application.ini [production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path =…
Jalpesh Patel
  • 3,150
  • 10
  • 44
  • 68
0
votes
2 answers

Multi Login ZF2 with multi session

I have an application with 3 different logins (3 different dashboard). Not to write duplicate code I created an adapter and a plugin to login. Now how can I manage 3 different sessions. If I run in to login Login 1 must also be signed on dashboard 2…
Carol Casta
  • 75
  • 1
  • 9
0
votes
1 answer

Zend Framework 1.12, execution of raw SQL inserts the same record twice

I know there´s a similar situation in stack, and I´ve already checked it out and the answers have not guided me to mine. Here´s the deal: I need to execute raw SQL, an INSERT to be precise. I have multiple values to insert as well. No problem since…
Chayemor
  • 3,577
  • 4
  • 31
  • 54
0
votes
1 answer

How to make this query in Zend DB?

I'm trying to have Zend DB generate the following query: SELECT DISTINCT US.nombre AS Cliente, VE.id_venta, VE.fecha, VE.total, ve.observacion FROM usuarios AS US, ventas AS VE I have tried the code below, but it does…
0
votes
1 answer

How to use Zend\Db in Zend Framework 2 in a real world project? A quest about foreign keys and relationships

I've completed the tutorial of Zend 2 and feel a bit disappointed by the Zend\Db component. Indeed, it's not able to handle foreign keys (as a built in). How to approach this problem for a real world project (at lease ten different tables and…
AsTeR
  • 7,247
  • 14
  • 60
  • 99
0
votes
3 answers

Explain this Zend_Select and Convert to SQL Query?

$select->from(array('u'=>'user'),array('count'=>'distinct count(*)')) ->joinLeft( array('d' => 'details'), 'u.detailsid = d.detailsid', array()); I…
tread
  • 10,133
  • 17
  • 95
  • 170
0
votes
2 answers

Zend Db Sql Where

Hi how can I do a query like this in zf2 with zend\db\sql? Query: SELECT * FROM table WHERE field = $field AND data > SUBDATE(NOW(), INTERVAL 1 DAY) In ZF2 $select = $this->sql->select(); $select->from(self::MYTABLE) …