![]() |
handle duplicate entry tips - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: handle duplicate entry tips (/showthread.php?tid=26972) |
handle duplicate entry tips - El Forum - 01-28-2010 [eluser]sasori[/eluser] Hi, can you guys give me tips or code snippets how handle the attempted duplicate entries in db ? here's my controller code Code: public function create_member() here's my model function Code: public function create_member() here's the error am getting, it doesn't look good coz the table columns appear LOL Code: A Database Error Occurred handle duplicate entry tips - El Forum - 01-28-2010 [eluser]flaky[/eluser] do a check before inserting if the primary key exists Code: $this->db->where('user', $this->input->post('username')); handle duplicate entry tips - El Forum - 01-28-2010 [eluser]sasori[/eluser] cool, thanks for the idea. i altered my model function Code: public function create_member() then i added this snippet to my view Code: if(isset($msg)) now it works, awesome ![]() handle duplicate entry tips - El Forum - 01-28-2010 [eluser]Joshua Logsdon[/eluser] Hi sasori, if you ever want more info or ways to go about it you can check out this recent thread: http://ellislab.com/forums/viewthread/142811/ handle duplicate entry tips - El Forum - 01-28-2010 [eluser]sasori[/eluser] great. thanks. am now subscribed to the topics am having trouble with specially these ones that I started handle duplicate entry tips - El Forum - 10-06-2012 [eluser]Unknown[/eluser] Thanks , it was very useful ![]() |