I am new to cakephp and I am currently working on this app where I need (for security purposes) to match data of inputted student ID on the data from my studentlist table. So in my studentlist table I have two fields one is the id and the other is the studentid so whenever a student wants to register to the website he/she needs to enter a studentid and when the studentid that is entered is not on the database he/she cannot register.
I have this view/add code
echo $this->Form->input('studentlist_id', array('type'=>'text', 'label'=>'Student ID'));
and my model code
var $name = 'Studentlist';
var $displayField = 'studentid';
var $validate = array(
'id' => array(
'notempty' => array(
'rule' => array('notempty'),
and my users_controller code
$studentlists = $this->User->Studentlist->find('list');
$this->set(compact('studentlists'));
please help... I've been searching and tweaking the codes but can't seem to find the answers... I am like really new to cakephp so I am really sorry in advance...