php - Object of class charts could not be converted to string
I have written a class for which the constructor function has 3 arguments. In some function of the class I have to query from db like this $profit_row->operating_profit.
now instead of writing operating_profit, I want to pass it as a variable to the constructor of the class. So my whole variable becomes $profit_row->$this->num where $this->num is initialized in the constructor.
When I do this I get the following error. How to go about this. Object of class charts could not be converted to string
Answer
Solution:
Maybe this is what you are looking for?
Answer
Solution:
you have a precedence problem.