Tag: mysql
Dirty Rows and Audit Trails with Zend_Db_Table
There are various ways to update rows in a database table using the Zend_Db_Table components. You can use use Zend_Db_Table::update(), like so:
$table = My_Table();
$table->update(array('age' => 22), 'id = 1');
or retrieve the row, and update it:
$table = My_Table();
$row = $table->find(1)->current();
$row->age = 22;
$row->save();
The big difference between the two approaches is that by first retrieving the row, and […]
Posted: September 27th, 2008 under Database, Development, PHP, Zend Framework.
Tags: audit, columns, Database, db, framework, mysql, PHP, rows, tables, trail, zend
Comments: none
Zend_Db: Setting MySQL's timezone per connection
I have a Linux server with a system timezone of ET (US/Eastern). But I also have a web application that needs to run in a timezone of PT (US/Pacific). Of course that's not a problem at all. I just set the timezone in my web application's bootstrap:
date_default_timezone_set('America/Los_Angeles'); // Pacific timezone
Now I have another problem; the […]
Posted: September 16th, 2008 under Development, PHP, Zend Framework.
Tags: date, dates, db, framework, mysql, PHP, timezone, zend
Comments: none
Zend_DB_Select Woes
It's no secret, I'm a fan of the Zend Framework, which I've been using since version 0.15. A lot of components have been added since then, and many of the initial components have been refactored and enhanced, and have matured. And that includes the Zend_Db_Select component, which has been evolving quite nicely, and even Zend_Db_Table_Abstract […]
Posted: July 25th, 2008 under Database, Development, PHP, Zend Framework.
Tags: mixin, mysql, PHP, select, sql, sqlite, tables, zend framework, zf
Comments: none
Modified DBDesigner
Earlier today I modified DBDesigner to, above all, not delete columns automatically after renaming the destination column in a relationship. It also displays "AI" for auto_increment columns, so I don't have to guess anymore whether I forgot to check that AI column without opening up the edit box for every single table, as there are […]
Posted: July 22nd, 2004 under Software & Tools.
Tags: Database, mysql
Comments: none