Delete from database ONLY if the uid from the database matches the uid in session |
Hello,
Once user is logged in, you should store user id (In your case uid) in session. And once user is pressing delete button which is having pid, should be checked with uid. For setting uid in session: $this->session->set_userdata('uid','userid'); For Delete use in model: $this->db->where('pid', $pid); $this->db->where('uid', $this->session->userdata('uid')); Thanks & Regards Tapan Thapa |
Messages In This Thread |
Delete from database ONLY if the uid from the database matches the uid in session - by Taylor - 03-02-2015, 05:14 PM
RE: Delete from database ONLY if the uid from the database matches the uid in session - by tapan.thapa - 03-02-2015, 11:17 PM
RE: Delete from database ONLY if the uid from the database matches the uid in session - by _this - 03-03-2015, 06:02 AM
|