Welcome Guest, Not a member yet? Register   Sign In
Validation is_unique
#1

HI , is it possible get on is_unique ( f.e. i have a table object with name is_unique[object.name])  the record corrispondent on db table ?
returning a message with " The name is already in database  , you entered it on [created_at]   "
Reply
#2

You can read on documentation https://www.codeigniter.com/user_guide/l...r-messages
Reply
#3

(02-26-2024, 09:21 PM)ddevsr Wrote: You can read on documentation https://www.codeigniter.com/user_guide/l...r-messages

hi , i user always custom error f.e :

Code:
                                    'nome'=>[
                                                'label'=>'Nome',
                                                'rules'=>'required|is_unique[clienti.nome]|max_length[50]',
                                                'errors'=>[
                                                            'is_unique'=>'{field} gia` presente', 
                                                            'max_length'=>'Lunghezza massima {field} {param}  caratteri',
                                                            'required'=>'Nome obbligatorio'
                                                          ]
                                                ],

But i want return the row( or rows ) from db in error
Reply




Theme © iAndrew 2016 - Forum software by © MyBB