just trying to understand this code.
$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
$query = $db->query(...);
foreach ($query->rows as $setting) {
...
}
I haven’t seen this before: $query->rows
Does this mean that the for-each loop in accessing the variable rows within the function query?
It means
$queryis an Object, not a function.rowsis a property of that object. A dumbed downqueryclass could look like:Where
$db->query(...);returns an object of typeClassname. Probably the real name is something likeQuery. Of course the class for your actual object is much more complex androwsis an array.