Hi, I have a class named user and within that class I store a database object (the object is passed as an argument to my constructor). The database object is store in a class variable named $db.
The functions in my user class need to perform database operations using the database object ( ex. querying, fetching rows, etc... ).
I am getting an error when I try to use my db object, it has to do with the way im using it.
According to the php parser, this line produces an error:
if ( !$res = ($this->db)->query( $query ) )
It has to do with the parenthesis, but to me, the above line makes sense, what's wrong with that? If I do: $this->db->query(...) the error disappears but I care about the order of operations. Any suggestions? Thanks
Oh, and the error I get is:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in C:\web programming\Omega III\classes\User.php on line 81 (which is the line above)