I want to read rows from a SQL and use them to create objects and finally put these objects in an array. But in the end my methods (of the class Object) do not print the name of the object. The code to read only one line works, so the problem is certainly in the array .
<?php
require_once 'Object.php';
require("connect.inc");
connect_db() or die ("Error.");
$result=mysql_query("SELECT * FROM object") or die ("Error");
$count = 0;
$c[] = array();
while ($line=mysql_fetch_array($result) && $count < 6) {
$count ++;
$c[$count] = new Object($line);
}
print ($c[1]->getName()); // Example
?>