i often use this handy sql query to make my queries from mysql database into an array like this:
$config  = array();
$sql = "SELECT config_name, config_desc,config_value FROM ".$db_prefix."config";
$result = mysql_query($sql ,$db);
	if ($myrow = mysql_fetch_array($result)) {
		do  {
			$config[$myrow['config_name']] = $myrow['config_value'];
		} while ($myrow = mysql_fetch_array($result));
	} else {
		 PageError ('ALERT: 12 There was an error with your request');
	}