I am building a class library and having problems with setting/returning 3d arrays. Here is the part the creates the array (its created from a database result set), the database connection is working as I can return the count.
class db_select extends db_config {
var $sql, $num, $count, $row;
function db_set_select($sql, $num) {
$qry = mysql_query($sql);
$this->count = mysql_num_rows($qry);
$i=0;
while($out = mysql_fetch_array($qry)) {
for($j=0; $j<$num; $j++){
$this->$row[$i][$j] = $out[$j];
}
$i++;
}
}
function db_get_select() {
return $this->row;
}
function db_get_count() {
return $this->count;
}
}
this is what I output:
$result = $db_obj->db_get_select();
echo "<br>The array \$result contains ".count($result)."
Nothing gets return in the array, any ideas ??
Thanks for any help.