The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
Validate Across Columns - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28) +--- Forum: Documentation (https://userspice.com/forums/forumdisplay.php?fid=30) +--- Thread: Validate Across Columns (/showthread.php?tid=520) |
Validate Across Columns - tradeJmark - 04-09-2017 Hi, all, Is there any way to use the Validate class to verify if a combination of values is unique across multiple columns? I mean, in the same way that composite primary keys need to be unique. Or, will I have to do that a different way? Thanks for the help, Tim Meredith Validate Across Columns - mudmin - 04-10-2017 The validate class won't do that by itself, so basically you'll have to run a query like Code: $checkQ = $db->query("SELECT * FROM users WHERE Code: $checkC = $checkQ->count(); Code: if($checkC < 1) { //do something Code: } |