Access to the User_data -> username into my CI_SESSIONS database when I make a query - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Access to the User_data -> username into my CI_SESSIONS database when I make a query (/showthread.php?tid=57076) |
Access to the User_data -> username into my CI_SESSIONS database when I make a query - El Forum - 02-12-2013 [eluser]GonzaFY[/eluser] THE SOLUTION IS AT THE END! I am working in a function to get online users but I am having troubles making the query.. Code: public function Estado($usuario) The problem is that I need check if the username stored in the user_data(serialized) is the same as the user that I am checking if is online. If you don't understand me my user_data says: Code: a:7:{s:9:"user_data";s:0:"";s:2:"id";s:1:"1";s:7:"usuario";s:7:"gonzafy";s:6:"nombre";s:7:"Gonzalo";s:8:"apellido";s:16:"Fernandez";s:5:"rango";s:1:"2";s:8:"conexion";b:1;} Then I need do: Code: // CHECK user_data[usuario] .. Do you understand me? I don't wanna use db->like('user_data', $usuario) because if two users have similar names like: Gonza and GonzaFY, when I am checking Gonza's connection I can get GonzaFY too so will cause troubles.. Thanks.. SOLUTION I am so stupid... I only needed to request the last sessions and then check if those has userdata, if it has the user is connected so I only need get the username.. Code: public function Todos() and then I call it (I am trying from my controller) Code: function conectados() Access to the User_data -> username into my CI_SESSIONS database when I make a query - El Forum - 02-13-2013 [eluser]LuckyFella73[/eluser] post deleted .. irrelevant ... |