Welcome Guest, Not a member yet? Register   Sign In
Update data with (,) using is_unique is not work. Codeigniter v.4.4.3
#1

Hi all.
I have problem with is_unique feature. I want to update data using is_unique feature but when I submit with the same data with comma it's make error "Title field must contain a unique value.". I'm using Codeigniter v.4.4.3

Here my code :

PHP Code:
$postTitle $postData['title'];

service('validation')->setRules([
    'title' => [
                'label'  => 'Title',
                'rules'  => [
                              'is_unique[t_post.title,title,{$postTitle}]'
                ]
  ]
]);

if ( 
service('validation')->withRequest(service('request'))->run() )
{
    // ready to update.

else 
{
    ddservice('validation')->getErrors() );



Current data title is : This is new post title

When I push : This is new post title
it's work properly.

When I push : This is new, post title       (with comma)
it's make error : Title field must contain a unique value.

So, I need help about that.
Reply


Messages In This Thread
Update data with (,) using is_unique is not work. Codeigniter v.4.4.3 - by adimancifi - 12-13-2023, 04:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB