I've written a class that reads a database into an array. This works fine,
but when I try to copy the array outside the class using a function that
only does a return $this->$data, I only get one sub-array of the whole one.

Any ideas?

Thanks

Alexander

Code:

class Adressen {
 var $connect; // database-handle
 var $daten = array(); // array for data

 // Constructor
 function Adressen($datenbank) {
  $this->$connect = $datenbank->getConnect();
 }

 // read data from database
 function readData() {
  $this->$daten = array();
  $result = mysql_query("select * from adressen");
  while($data = mysql_fetch_array($result)) {
   extract($data);
   $this->$daten[$AdressenID] = array("strasse" => $Strasse, "plz" => $PLZ,
"ort" => $Ort, "land" => $Land, "telefon" => $Telefon, "telefax" =>
$Telefax, "email" => $Email);
  }
 }

 function getData() {
  return $this->$daten;
 }
}



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to