I had this working yesterday, i did, honest.
I have a class the puts recordsets into an 3d array, except it doesnt seem to return anything. Is there a problem with returnning multi dimentional arrays from an object ?, or is my code just rubbish ?
here is the function in the class that creates the array.
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;
}
here is the calling code:
$sql = "SELECT * FROM user";
$db_sel->db_set_select($sql, "2");
$count = $db_sel->db_get_count();
$result = $db_sel->db_get_select();
for($r=0; $r<$count; $r++){
echo $result[$r][0]." ".$result[$r][1]."<br>";
}
ok, $count returnes 15 results, but $result is empty !!!
please help with any suggestions.
cheers