Welcome Guest, Not a member yet? Register   Sign In
Display Record
#1

Hi coders,



how to display record where user is equal to session user. i have code below that i don't know exactly the syntax.

PHP Code:
$this->db->where('users.fname',$this->session->userdata('fname')); 

code above is not work as what i need.

please any help.
Reply
#2

have you save the session before? (set_userdata)
Reply
#3

Did you check database and session user guides?
there is everything you need..
Best VPS Hosting : Digital Ocean
Reply
#4

You do know that ->where() only sets the WHERE statement, and does not execute the query. I think you are looking for ->get_where().
After the query has run, you can display the query ran with $this->db->last_query() which returns the last ran query.
Reply
#5

Okay.. thanks all you guys,

i got the solution here:
PHP Code:
$this->db->where('users.fname',$this->session->userdata['logged_in']['fname']); 
Reply
#6

Thank you for the feedback and your solution.

Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB