php - not getting user name and id from database in codeigniter -
I have changed my code and I am getting user email and password, but can not get name and id? What's the problem? Plus I'm getting an error undefined index ID and name?
Public function login () {$ users = array ('email' => $ this-> Input-> Post ('email'), 'password' = & Gt; This-> Input-> Post ('password'), TRUE); $ Users ['password'], 'name' = & gt; $ Users ('count ($ users)) {$ my_data = array (' email '= & gt; $ users [' email '],' password '= & gt; $ users [' name '],' id '= & Gt; $ user ['id'], 'login' = & gt; TRUE); $ This- & gt; Session-> Set_user data ($ my_data); Var_dump ($ my_data); }}
This is my var_dump
'session_id' = & gt; String 'fa71c96123ea05c8c10ec8c49d125f5c' (length = 32) 'ip_address' = & gt; String '127.0.0.1' (length = 9) 'user_agent' = & gt; String 'Mozilla / 5.0 (Windows NT 6.2; Voice 64; RV: 33.0) Geico / 20100101' Last Activeness' => Int 1415150854 'user_data' = & gt; String '' (length = 0) 'email' = & gt; String 'safir.syed@hotmail.com' (length = 22) 'password' => String 'Kingston 12' (length = 10) 'name' = & gt; Zero 'id' = & gt; Zero 'log in' => Boolean truth
Check your code:
public Function Login () {$ users = array ('email' = & gt; $ this-> Input- & gt; Post ('email'), 'password' = & gt; $ this-> Input- & Gt; password '),' id '= & gt; $ -> this- & gt; Input-> Post ('id'), 'name' = & gt; $ This- & gt; Input-> post name ')); $ Users ['password'], 'name' = & gt; $ Users ('count ($ users)) {$ my_data = array (' email '= & gt; $ users [' email '],' password '= & gt; $ users [' name '],' id '= & Gt; $ user ['id'], 'login' = & gt; TRUE); $ This- & gt; Session-> Set_user data ($ my_data); Var_dump ($ my_data); }}
Comments
Post a Comment