updating on database with form validation - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: updating on database with form validation (/showthread.php?tid=67938) |
updating on database with form validation - saifabid123 - 04-27-2017 I have a form filled with inputs , wich i form validate them , i have a problem with two of them , 'matricule' and 'email' , in my callback function i set that if when of those tow exists in the table, it won't be no insert or update , so my problem is when i want to update other fields without changing these two , an error will be shown saying that the allready exists. Can u tell me please how to solve this problem here is some code : My controller function : Code: public function unique_matricule($matricule) my $all_matricules array is this :[{"matricule":"123123"},{"matricule":"140273"},{"matricule":"231564"}] So when i select the row that i want to modify , i want my code to delete its matricule from this array with unset function, can u tell me please what i have done wrong ? Thank you! |