I have very basic class:
class Customer {
protected $id;
protected $customer;
public function __construct($customer_id) {
$this->id = $customer_id;
return $this->set_customer();
}
protected function set_customer() {
$query = mysql_query("SELECT * FROM customer WHERE id = '$this->id'");
$this->customer = mysql_fetch_row($query);
return $this->customer;
}
}
$customer = new Customer($order->customer->id);
print_r($customer);
This is not doing what I want it to but I understand why... $customer returns a reference to the Customer Object...
What I want is the MySQL row array from the mysql_fetch_row() - How do I return the array?
What am I missing?