I have a simple Left query on mysql
SELECT sp. * , p.name, p.date_created
FROM subpages sp
LEFT JOIN pages p ON p.id = sp.page_id
I dont know how to execuite this query from zend framework.
I have a Mapper Page, which access a DbTable page which is extending Zend_Db_Table_Abstract. I read some articles so i suppose statement should look something like this from the mapper
$select = $this -> DbTable() -> select();
$select -> joinleft(..... This is what I dont know how to write....);
$results = $this -> DbTable() -> fetchAll($select);
if($results) { return $result; }
In the article, $select -> from()
were used, that where my mind is stuck , why do we need to write $select -> from("subpages")
when It will already be defined in the DbTable page.
How to write the join statement properly?