PHP: Array of objects is empty when I come to retrieve one from the array
- by Tom
Good morning,
I am trying to load rows from a database and then create objects from them and add these objects to a private array.
Here are my classes:
<?php
include("databaseconnect.php");
class stationItem {
private $code = '';
private $description = '';
public function setCode($code ){
$this->code = $code;
}
…