prevent duplicate for Composite key columns |
working environment: XAMPP on Windows 10
have Unique Index - Composite: Code: ALTER TABLE `sales`.`brand_categories` when user will save a duplicate entry for the combination of both columns, database will throw error. but is there a builtin validation rule which is suitable for it like is_unique. if yes please guide How To. if no builtin validation rule then how i can write a custome validation rule and prevent duplicate in this case please help. in Model have validation rule (this is just sample what i can do -as per my basic knowledge- for uniqueness of a single column) Code: protected $validationRules = [ regards Newbie here in CodeIgniter World !! Please appologize if any nonsense from me.
environment: Windows 10, XAMPP 3.3.0, VS Code, SQLyog Community Ed.
|
Messages In This Thread |
prevent duplicate for Composite key columns - by Ahmed Haroon - 05-20-2022, 03:15 AM
RE: prevent duplicate for Composite key columns - by kenjis - 05-21-2022, 05:24 PM
RE: prevent duplicate for Composite key columns - by Ahmed Haroon - 05-22-2022, 09:49 PM
RE: prevent duplicate for Composite key columns - by Ahmed Haroon - 05-23-2022, 11:31 PM
RE: prevent duplicate for Composite key columns - by kenjis - 05-24-2022, 12:16 AM
RE: prevent duplicate for Composite key columns - by Ahmed Haroon - 05-24-2022, 10:19 PM
|