Welcome Guest, Not a member yet? Register   Sign In
query error
#1

[eluser]basty_dread[/eluser]
i use this query

Code:
function checkifkewordlist(&$islist,$keyno){
            $this->internalvalidate();
            $query = $this->db->query("select iKeywordList from tblkeywords where iKeywordNo = ".$keyno);
            $row = $query->row();
            $islist = $row->iKeywordList;
        }


this is the error:

Code:
Severity: Notice
Message: Trying to get property of non-object

how this become an error?

what could possibly wrong?
#2

[eluser]theprodigy[/eluser]
if your query returns an error, it won't be an object, and as such won't have the iKeywordList property.
#3

[eluser]basty_dread[/eluser]
what could be wrong with my query?
#4

[eluser]theprodigy[/eluser]
Quote:function checkifkewordlist(&$islist,$keyno){
$this->internalvalidate();
$query = $this->db->query("select iKeywordList from tblkeywords where iKeywordNo = ".$keyno);
print_r($query); <----- This will tell you what could be wrong.
$row = $query->row();
$islist = $row->iKeywordList;
}
Now just remember, I never said there WAS something wrong with your query. I merely suggested a possible reason why you are getting the error you are.

But if you put your print_r (as I did up above), you may see what is going on.
#5

[eluser]basty_dread[/eluser]
ok thanks for the help, i will see what is error.. thanks
#6

[eluser]basty_dread[/eluser]
here is what i printed

Code:
CI_DB_mysql_result Object ( [conn_id] => Resource id #28 [result_id] => Resource id #43 [result_array] => Array ( ) [result_object] => Array ( ) [current_row] => 0 [num_rows] => 0 [row_data] => )




Theme © iAndrew 2016 - Forum software by © MyBB