zend-db

Zend_Db query Mysqli prepare error: Operand should contain 1 column(s)

I have a problem with a query that works in phpmyadmin but not with Zend_db. You can read about the query in http://stackoverflow.com/questions/1268376/sql-statement-with-several-joins I have these tables Post ID entry Category ID name CategoryBinding ID postID categoryID And this is my php code: clas...

Zend_Db last_insert_id returns super big number

Hello, I have a MySql table whose primary key is a 64bit BigInt I'm using Zend_Db (Zend Framework 1.8.4) to insert a new row, then call lastInsertId() to retreive the new row's id, what I get back is a super large number such as 18446744072633694008, and this number changes from time to time, but always this large. the auto increment ...

Zend_DB_Select : why are all fields returned?

public function getWorksheetData($id) { /** create the following query using select object: SELECT wc.label, wd.notes FROM worksheet_data wd LEFT JOIN worksheet_columns wc ON wd.column_id = wc.id; */ $id = (int) $id; $select = $this->_db->select() ->from(array('wd'=>'worksheet_data'), array('wc.label','wd.notes')) ->join(arr...

How to get binary dump of SQLite memory db

Hello! If i have code like this $dbSL = Zend_Db::factory('pdo_sqlite', array('dbname'=>':memory:')); $dbSL->query('CREATE TABLE ...'); $dbSL->query('CREATE TABLE ...'); ... After that i whant take binary dump of this SQLite db Thx in advice! ...

Relationship between Table, Rowset and Rows in Zend Framework?

Hi, I'm working on a project that requires a fair bit of inserting/updating rows in MySQL tables using Zend_Form. I'm trying to simplify the insert/update procedure by extending Zend_Db, and it seems a lot of this has been done with Zend_Db_Table and Zend_Db_Table_Row. However, I can't understand how to link them together in the most ...

pdo_mysql vs mysqli when using Zend_Db

If I am using Zend_Db classes to abstract my queries from the backend database, does it make a difference which mysql driver I use, pdo_mysql vs. mysqli? My understanding of pdo_mysql is it is also to provide abstraction, so I'm assuming that if I am using Zend_Db, then I would not be taking advantage of the extra features as part of mys...

Charsets in general, with specific questions regards Zend DB - incorrect display of data.

Hello, I'm having trouble in my Zend Framework App displaying the correct characters. EG/ rue de l'Odéon Displays as: rue de l'Od�on When displaying information through a webservice and also by displaying it through the applications view. I have tryed the following things: 1) Set the character encoding in the view. $view->setEn...

To get the complete row with join tables in Zend_Db_Table

This is my table structure. http://img6.imageshack.us/img6/8730/articlek.jpg I want to get a article row object from id with section and category names instead of section_id and category_id ,And user names instead of author_id and modified_by. Please help me. ...

Zend Framework relationships - defining column names in findManyToManyRowset()?

Hi, I'm working on an application developed using Zend Framework. I have defined relationships in models, and can use them happily, e.g: $rowset = $row->findManyToManyRowset('People', 'Jobs'); However, i've hit a problem where the rowset is returned has column names that are the same in 'People' and 'Jobs', and therefore, merges the...

zend relationships with select

I am new to zend. I have been asked to redevelop a website that was once written in plain PHP and put it into the zend framework. I am having a lot of trouble with database relationships, I cant seem to get my head round defining and querying relationships. I would like to find a Category. From that Category I would like to be able to ...

Zend_Db_Table_Abstract and Default Scope

Is there a way to add a default scope to a Zend_Db_Table_Abstract based model. I want to be able to query a model with some conditions taken as default. e.g. deleted = false order name asc ...

Zend_Db _Table_Abstract and Left Joins

Is there a way to do a left join within a Zend_Db_Table_Abstract based model. I would like to retrieve a record with a left join to another table so that I am able to query all the fields as if they were the same table. Any examples would be useful Thanks guys ...

Zend_Db_Select order by random, compatible in mssql / mysql

Alright here's the situation, I have an application written in the Zend_Framework, that is compatible with both MySQL and MSSQL as the backend. Now, ZF is pretty good at solving a lot of the SQL discrepancies/differences between the two languages, but I still have yet to figure this one out. The objective is to select 1 random record f...

Zend_Db: Adapter suddenly is null!

Hey there, I'm using Zend_Db in one of my projects. Now I have the problem, that suddenly during the code execution, the variable $_db in Zend_Db_Adapter_Abstract is null. (shown by var_dump($this); in my DbTable_xx class). It seems like the adapter is set to null somewhere during the script execution. How can that happen? Unfortuna...

What is the current way in which I can add an object to the database using Zend Framework?

I want to save an object or form to the database. Only I can't find the easiest (or normal) way for how to do this. I found a lot of tutorials, but none seem to be easy or current. Can someone please help me with this? I use version 1.9.3 of the Zend Framework. ...

connecting to two different databases with Zend Framework

I have here a medium sized intranet site which is written entirely in Zend FW. The database for the intranet is located on another server. Now I need to extend the intranet with some new functionality. In order to do this I need to connect to another database on the same server (and same DBMS). The question is now: What is the best way ...

No adapter for type Zend_Db_Table_Row error?

Hi, I have a project in which I use more than one adapter. So In ma models i created an abstract model abstract My_Config1_Model extends Zend_Db_Table_Abstract { public function init() { $db = Zend_Registry::get('dbcon')->getDb(Kiga_Data_Database::MASTER); $this->setDefaultAdapter($db); } } and then I inherit...

Using Zend Framework Db Tables without MVC

Hi All I am trying to use the Zend Framework without using the MVC structure, specifically the Db_Table classes. I have created a couple of classes representing my database tables i.e class DBTables_Templates extends Zend_Db_Table_Abstract { protected $_name = "templates"; } When I try to instantiate this class (it is included...

Saving row after populating from Array - Zend

Hi All 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 Table class class DBTables_Users extends Zend_Db_Table_Abstract { protected ...

Zend_Db: Filter results

Hey there, does anyone know the best practice to filter all the results I'm getting from any Zend_Db class. It's because I've got a whole database with timestamps as INTs and I want to change the fields into Mysql's TIMESTAMP without having to change too much code. It would be nice if I could apply a global database filter using strto...