I have the very simple class:
class ActionCode_Controller extends Page_Controller
{
function ActionCodeForm() {
...
}
function CheckCode($data, $form) {
$test = DataObject::get_one("ActionCode", "`Code`='".$data['Code']."'");
if($test){
echo "yes";
}
else {
echo "no";
}
}
}
I try to get the Code from the database. If it's in (temporary) shout yes, if it's not (temporary) shout no.
But it always shouts no (returns false) Even if I put in `Code`= '1234'.
What am I doing wrong?