05-10-2009, 01:45 AM
|
#2 (permalink)
|
|
The Addict
Join Date: Jun 2008
Posts: 335
Thanks: 2
|
It is a personal preference of mine, but I prefer to avoid switch statements when possible so I thought perhaps you would share this same bias and maybe prefer this way.
PHP Code:
public function fetch($fetch_type = 'array') { $types = array( 'array' => MYSQL_NUM, 'assoc' => MYSQL_ASSOC, 'both' => MYSQL_BOTH ); if( array_key_exists($fetch_type, $types) ) { return mysql_fetch_array($this->results, $types[$fetch_type]); } }
|
|
|
|