I am new to cakePHP and i am reading the manuels and have bought the book, i have come across a issue and need some assistance.
At the moment i query my DB like this (this is the whole class) :
<?php
class TapplicantController extends AppController {
public function index() {
$this->set('page_title', 'Dashboard');
$tapplicant = $this->Tapplicant->query("SELECT tapplicant.AppID, tapplicant.AppIPAddress, tapplicant.AppAffID, tapplicant.AppDate, tapplicant.FirstName, tapplicant.LastName, tapplicant.Email, tapplicant.AppDomain, toutcome.AffCommission FROM tapplicant INNER JOIN toutcome ON tapplicant.AppID=toutcome.AppID LIMIT 0,15 ");
$this->set('tapplicant', $tapplicant );
}
}
and then i display it like this and it works fine :
<?php foreach ($tapplicant as $tapplicant) : ?>
<tr>
<td><?=$tapplicant['tapplicant']['AppID']; ?></td>
<td><?=$tapplicant['tapplicant']['AppAffID']; ?></td>
<td><?=$tapplicant['tapplicant']['FirstName']; ?></td>
<td><?=$tapplicant['tapplicant']['LastName']; ?></td>
<td><?=$tapplicant['tapplicant']['Email']; ?></td>
<td><?=$tapplicant['tapplicant']['AppDate']; ?></td>
<td><?=$tapplicant['tapplicant']['AppDomain']; ?></td>
<td><?=$tapplicant['tapplicant']['AffCommission']; ?></td>
</tr>
<?php endforeach; ?>
The problem is i have Inner Joined 2 tables and its not working , i get the following error : Undefined index: AffCommission