A colum in my databse table has alphanumeric values. I want to get only the rows, having numeric values in this column.
$this->Mymodel->find('all',
'condition' => array('Mymodel.field') => ???)
);
A colum in my databse table has alphanumeric values. I want to get only the rows, having numeric values in this column.
$this->Mymodel->find('all',
'condition' => array('Mymodel.field') => ???)
);
If you're using MySQL, you could use Regular Expressions.
$this->Mymodel->find('all', 'conditions' => array('Mymodel.field REGEXP "^[0-9]+$"'));