Welcome Guest, Not a member yet? Register   Sign In
is unique validation has Bug!!??
#1

Hi,I try this validation but not work!!!

PHP Code:
is_unique[table.field,ignore_field,ignore_value]
//is_unique[auth_user.specia_colum] 
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply
#2

Hello! It seems like you're having trouble with the is_unique validation rule in PHP. The is_unique validation rule is used to ensure that a value entered for a field is unique within a specified database table. It helps prevent duplicate entries.

From your code snippet, it appears that you are trying to use the is_unique validation rule, but there might be a few issues. Let's break down your example:


PHP Code:
is_unique[table.field,ignore_field,ignore_value]
//is_unique[auth_user.specia_colum] 


The correct syntax for using the is_unique validation rule is as follows:

PHP Code:
is_unique[table.field

If you want to provide additional conditions to ignore certain records during the uniqueness check, you can use the following syntax:

PHP Code:
is_unique[table.field,ignore_field,ignore_value

Here's how you can correct your code based on the example you provided:

PHP Code:
is_unique[auth_user.specia_columnidignore_value
In this example:

auth_user is the name of the table.
specia_column is the name of the column you want to validate for uniqueness. pokemon fusion
id is the name of the field you want to ignore during the uniqueness check (this is usually the primary key).
ignore_value is the value of the ignored field (for example, the primary key value of the current record you are updating).
Remember to replace id and ignore_value with the actual names and values that are relevant to your use case.

If you're still encountering issues, it could be related to other parts of your code or your database setup. Make sure that the syntax and logic for the is_unique rule are correct, and also check if there are any other validation rules or conditions that might affect the behavior.
Reply
#3

my previous post is still not approved yet
Reply




Theme © iAndrew 2016 - Forum software by © MyBB