[eluser]phpworker[/eluser]
Hello there, seems this is my second post here
OK, this is the problem: I am creating my first bigger project with CI and there's a problem I do not understand. I have the following code in my main controller:
Code:
$q = 'select login,password,name,surname,group_id from '.$this->tb['users'].' where login="'.$data['login'].'" and password="'.$data['password'].'" and name="dsdsdsd"';
$query = $this->db->query($q);
if($query == false)
echo "<br>login: query = false";
else
echo "<br>login num_rows=".$query->num_rows();
if ($query->num_rows() == 1)
{
// succeed
$r = $query->row_array();
$d1 = array(
'user_id' => $r['id']
,'login' => $r['login']
,'user_name' => $r['name'].' '.$r['surname']
,'group_id' => $r['group_id']
);
$this->session->set_userdata($d1);
And that gives me errors like "Undefined index: id" but $query->num_rows() gives me 1. I also added in query one dummy value "dsdsdsd" for column "name" and still there is one row returned :/
It seems CI doesn't generate any results. I have no idea what to do to solve it.
Any help, please?
I use OCI8 with Oracle database v9.2. Of course connection with it was previously tested.