handle duplicate entry tips |
[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
[eluser]flaky[/eluser]
do a check before inserting if the primary key exists Code: $this->db->where('user', $this->input->post('username'));
[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 ![]()
[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/
[eluser]sasori[/eluser]
great. thanks. am now subscribed to the topics am having trouble with specially these ones that I started
|
Welcome Guest, Not a member yet? Register Sign In |