Print specific values from dictionary with a specific key name
Siten0308 - Jun 20 2019 01:43 PM
How to make code run differently depending on the platform it is running on?
xarzu - Apr 05 2019 09:17 AM
How do I set a breakpoint in an attached process in visual studio
xarzu - Apr 04 2019 11:47 AM
Recent Blog Entries
Recent Status Updates
- Managed C++
- Visual Basic 4 / 5 / 6
- linked list
- hello world
Posted 21 December 2013 - 07:28 AM
Been at this a while and its driving my mad, so I have a a class to grab the DB info, it grabs a reference of $this. to grab the whole class.
Then I assign it to a var in another class constructer
$this->sql = $sql;
So when I go to run the runQuery function within the class it errors with:
Fatal error: Call to a member function runQuery() on a non-object
I have tried the following:
Can anyone point me where I am going wrong?
Posted 21 December 2013 - 08:25 AM Best Answer
Fixed this issue by passing pointers to the constructor.
Posted 03 January 2014 - 12:05 AM
Another way is to create a database wrapper using the "singleton" pattern. This way you don't need to pass pointers, just create a method to retrieve the db object from the wrapper.
I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.