Hi everyone. Old to coding but new to here.
Im creating a class called ‘ownership’ which has a number of properties.
What I want to do is create an array of the class, and have a method called ‘getOwnerships’ that queries a MySQL database and returns a number of ownership records thus adding rows to an array of the class.
I’ve made a class that does the database query with its relevant methods and have:
public function getOwnerships() {
global $thisConnection;
$results=$thisConnection->processSql(my query**);
foreach($results as $result) {
}
}
But now I’m stuck as to how to go about it. I’m sure its quite simple in reality. Any ideas please?
Thanks in advance,
Chris.