Welcome Guest, Not a member yet? Register   Sign In
Delete from database ONLY if the uid from the database matches the uid in session
#2

(This post was last modified: 03-03-2015, 06:05 AM by tapan.thapa.)

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
Reply


Messages In This Thread
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



Theme © iAndrew 2016 - Forum software by © MyBB