Fantastic! Thank you! Cant wait to start using them.
Simon Mundy wrote:
Hi Jack
The answer to this is a big yes. Here's an example I had in the
documentation, it assumes we're trying to find all bug reports that
have been newly submitted by a user called 'Bob'. The foreign key is
bugs.reported_by which corresponds to accounts.account_id. It returns
a 'normal' rowset, of which each row is writeable as normal. It works
fine on a one-to-one or even a one-to-many (as long as you've grouped
the results!)
<?php
$table = new Bugs();
$select = $table->select();
$select->where('bug_status = ?', 'NEW')
->join('accounts', 'accounts.account_id = bugs.reported_by')
->where('accounts.account_name = ?', 'Bob')
->group('bugs.id');
$rows = $table->fetchAll($select);
Cheers
--
Simon Mundy | Director | PEPTOLAB
""" " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124
http://www.peptolab.com
--
Jack