Salve a tutti,
come faccio a salvare un recordset in un array?
Ho provato cosi:
Codice PHP:
class db{
protected $_handle;
protected $_result;
function query($query, $single_result=1){
$this->_result=mysql_query($query, $this->_handle) or die(mysql_error());
if(preg_match("/select/i", $query)){
$resul=array();
while($row=mysql_fetch_array($this->_result)){
$result[]=$row;
}
mysql_free_result($this->_result);
return $result;
}
}
}
//Prova classe
$db=new db;
$result=$db->query('select * from post');
echo $result['post_id'];
Ma non funziona 
Potete aiutarmi per favore?