Undefined index: id error

#11
[eluser]phpworker[/eluser]
One more thing. I have method in main controller which runs each time page is refreshed:
Code:
function handle_session_data()
    {
        if($this->session->userdata('group_id') == FALSE)
        {
            // zapisz dane w sesji
            $query = $this->db->getwhere($this->tb['users_groups'], array('id' => '0'));

            $newdata = array(
                   'user_name'    => 'Nieznajomy'
                   ,'group_id'    => '0'
                   ,'group_name'=> 'Goście'
            );
            $this->session->set_userdata($newdata);
            $this->content->content['group_name'] = $newdata['group_name'];
            $this->content->content['user_name'] = $newdata['user_name'];

        }else
        {
            $this->content->content['group_name'] = $this->session->userdata('group_name');
            $this->content->content['user_name'] = $this->session->userdata('user_name');
        }
    }

this: $this->content->content is variable of my own library Content that generates the result Smile

completely stucked with my code... Sad

#12
[eluser]phpworker[/eluser]
OK I found it Smile

The query should look like this:

Code:
$q = "select id,login,password,name,surname,group_id from ".$this->tb['users']." where login='".$data['login']."' and password='".$data['password']."'";

not like:

Code:
$q = 'select id,login,password,name,surname,group_id from '.$this->tb['users'].' where login="'.$data['login'].'" and password="'.$data['password'].'"';

It is Oracle specific issue. BTW, I've rearnt how to turn on error logging Smile

Thanks for quick response @deviant!

#13
[eluser]deviant[/eluser]
Yeah I figured it would be something to do with Oracle, and since I've like never used Oracle it would have been beyond me Tongue


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.