[Solar-talk] db exception on size exceeded

Jeff Surgeson solar at 3hex.com
Sun Jul 16 16:51:11 PDT 2006


Hi Paul

> >> Or is there a way to use a validation rule so that it returns some
> >> feedback so
> >> the person knows which field is creating the problem?
> >
> > ...
> >
> >> $this->_col['perform_bond'] = array(
> >> 	'type'    => 'varchar',
> >>         'size'    => 255,
> >>         'require' => true,
> >>         'valid' => array('multiple', 'VALID_TEXT',
> >>         	array(
> >>                     array('notBlank'),
> >>                     array('regex', '/^[[:alpha:][:digit:][:punct:]
> >> \s]+$/'),
> >>                 )
> >>         ),
> >> );
> >
> > For now, try adding a 'length' key to the validation array.
>
> Sorry, that should be 'maxLength'.

Works as expected, (with correct spelling) :-) solves my problem

I might be wrong but I would imagine that the chances of max data lenghts 
being exceeded are high especialy with shorter values and I have never known 
mysql to choke on it own on length other than to truncate the data.

But as always I know you will do what is right and uselfull for all :-)

Have a good one I'am off to bed!

-- 
Jeff Surgeson


More information about the solar-talk mailing list