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 = 7 (Vendor) // and is_active = 1 (Currently Active) $query = "select top(100)* from wh_account where account_type_id = '7' AND is_active = '1' "; //create an array of values that are returned by the query $myVendorArray = queryToArray($query); //If there are results from the query, print them out to the //screen. // Brief explanation of this array: // $myVendorArray 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] => BestISP [directory_account_id] => 0 [address_1] => 987 Service Lane [address_2] => [city] => Fakerton [state] => VA [zip_code] => 12345 [country] => [phone_number] => (555)555-1984 [alternate_phone_1] => [alternate_phone_2] => [fax_number] => [web_url] => http://www.bestISP.com [account_type_id] => 7 [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 "
"; if($myVendorArray != 0){ echo "".count($myVendorArray)." Active Vendors\n
"; for($k=0;$k"; } } echo "
"; //to quickly see all values returned, use the print_r function. //(commented out.) // echo "
\n";
	//		print_r($myVendorArray);
	//	echo "
\n"; ?>