|
||||
|
Not sure if this is what your after, but check this page out.
Zend Framework: Documentation |
|
||||
|
Thanks for the reply Elemental, but that is not really what I was talking about. I have found a little more info, on the Wiki, but still need a little more direction.
I am not sure if I am doing this the right way, but here is where I am to this point. In the /model/Asset.php as a test I created an additional class Assetinfo that extends Zend_Db_Table. In the constructor I am trying to create the select by: PHP Code:
PHP Code:
The objective is to execute a query like this: Code:
SELECT * FROM asset as a LEFT JOIN categories as c ON c.id = a.categories_id LEFT JOIN locations as l ON l.id = a.locations_id WHERE a.id = $id I could do this in many ways, but really want to keep everything portable and stay within the ZF. Last edited by swiftone : 08-15-2007 at 06:11 PM. |
|
||||
|
ok, there is implementation for joins within the Zend_Db_Select object. Documentation is scarce and I'm not sure how you would get to this object gracefully. Check out the API doc linked above.
I also found this from the mailing list. And this from these forums. Last edited by Elemental : 08-15-2007 at 08:32 PM. |
|
||||
|
Thanks for helping on this Elemental. I have really been pulling my hair out, and I didn't have much to begin with.
I do not claim that this is the best way to do it, or that it is correct, but here is how I solved this and got JOIN working within Zend Framework. /application/model/Asset.php PHP Code:
PHP Code:
HTML Code:
<table> <?php foreach($this->allAssetInfo as $asset) : ?> <tr> <td><?php echo $this->escape($asset['asset_categories_name']); ?></td> <td><?php echo $this->escape($asset['city']); ?></td> <td><?php echo $this->escape($asset['asset_name']); ?></td> </tr> <?php endforeach; ?> </table> Last edited by swiftone : 08-16-2007 at 07:25 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|