Re: Is it a bug of CakePHP?
| From: | nicolas figaro | Date: | Fri, 07 Apr 2006 08:49:59 +0000 |
| Subject: | Re: Is it a bug of CakePHP? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233420@lists.php.net to get a copy of this message | ||
Pham Huu Le Quoc Phuc a écrit :
I catch an error, could you tell me if you have some ideas? class Dsptraining extends AppModel {try this one : select max(start_date) as start_date from tbl_dsptrainings N Ffunction GetDsptrainings() { return $this->findBySql("select max(start_date) start_date fromtbl_dsptrainings");}} did you try your sql query directly using sql ?
class DsptrainingsController extends AppController
{
function index()
{
$data = $this->Dsptraining->GetDsptrainings();
echo $data[0]['start_date'];
}
}
Error message: Undefined index: start_date in
c:\Inetpub\wwwroot\Cake\app\controllers\dsptrainings_controller.php on line
33