0){ while($row = mssql_fetch_assoc($result)){ $arrayOfCustomerInformation[] = $row; } return $arrayOfCustomerInformation; } else { return 0; } } //generic query to pull top 100 values from the wh_account table //where the account_type_id = 1 (Customer) // and is_active = 1 (Currently Active) $query = "select top(100)* from wh_account where account_type_id = '1' AND is_active = '1' "; //generic query to pull all values from the wh_account table //(commented out) //$query = "select * from wh_account"; //create an array of values that are returned by the query $myCustomerArray = queryToArray($query); //If there are results from the query, print them out to the //screen. // Brief explanation of this array: // $myCustomerArray stores a multi-indexed array of accounts. // each index ($k) is a unique customer account. // each index ($k) has an associative array of key, value pairs // that can be referenced by name like this // // $myCustomerArray[$k]["address_1"] // //NOTE: These may change over time! /* [account_id] => 0 [owner_resource_id] => 4 [create_time] => May 16 2002 6:56AM [external_id] => [account_name] => Name [directory_account_id] => 0 [address_1] => 1234 Fake St [address_2] => [city] => Fakerton [state] => VA [zip_code] => 12345 [country] => [phone_number] => (555)555-1234 [alternate_phone_1] => [alternate_phone_2] => [fax_number] => [web_url] => http://www.customer.com [account_type_id] => 1 [key_account_icon_id] => [territory_id] => [market_segment_id] => 29682845 [competitor_id] => [parent_account_id] => [stock_symbol] => [stock_market] => [sic_code] => [asset_value] => [last_activity_time] => Sep 26 2009 3:31PM [external_accounting_id] => [is_active] => 1 [is_costed_client] => 0 [is_tax_exempt] => 0 [uses_parent_account_contracts] => 0 */ echo "
\n"; print_r($myCustomerArray); echo "\n"; ?>