Welcome Guest, Not a member yet? Register   Sign In
Save function
#2

That's not an error. You're telling it to check the database to make sure that the field slug is unique in the database. Since you're doing an update, it already exists. There are two other parts to the is_unique that you need to make use of. So your rule should be something like:

PHP Code:
'slug'  => 'is_unique[news.slug,slug,{slug}]'

This basically sets up a where clause that tells it which record to ignore when it checks for uniqueness. The {slug} acts as a placeholder for the value being set. So, it should ignore the record that has column slug that is equal to the value of slug that is being included in the data to insert.

Hopefully that makes sense.
Reply


Messages In This Thread
Save function - by edica - 10-26-2019, 10:32 AM
RE: Save function - by kilishan - 10-26-2019, 08:32 PM
RE: Save function - by edica - 10-28-2019, 08:15 AM
RE: Save function - by kilishan - 10-28-2019, 08:33 AM
RE: Save function - by edica - 10-29-2019, 05:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB