Hi Guys - I know that this is NOT a PHP forum, but I feel that some of
you use AMFPHP extensively, so I thought I'd give it a try.

I have just started to use AMFPHP as a backend for Flex2 projects.  
When I connect to MySQL databases it is just perfect and fast - great. 
 
Now I need to connect to a MS SQL Server 2000, it is a sql server used
by a MS Dynamics Navision installation.
The data stored are stored in a non UTF-8 charset and database names
include stupid names like [DK idé-nyt as$Insertion] where the sql
driver stumbles on the ´

When I use ADODB in PHP and json_encode the result, it works fine. 

When I try to use the following code in AMFPHP, the service browser
fails with a Flex error. 
 
What can I do, to make this work ? 
 
I'm quite new to PHP also, so please be gentle if you can :-) 
 
Thanks for any help you might provide. 

Thanks and sorry for this semi non-flex question 
Mark 
 
/**** Begin PHP snippet ***/ 
include_once('adodb5/adodb.inc.php'); 
 
$db =& ADONewConnection('odbc_mssql'); 
$DB->charSet = 'utf-8'; 
$dsn = "Driver={SQL Server};Server=10.45.2.33;Database=BRM;"; 
$db->Connect($dsn,'pfs','youbet'); 
$db->SetFetchMode(ADODB_FETCH_ASSOC); 
 
class ars {  
function ars () { 
/** 
Constructor function 
*/ 
}  
/** 
* Function getCustomer returnsinfo about cutomer 
* select top 100 * from [DK idé-nyt as$Customer]; 
* @access remote 
**/ 
 
function getCustomer ()  
{ 
global $db; 
$arr = array(); 
$sql = "select top 100 * from [DK idé-nyt as$Customer];"; 
$rs = &$db->Execute($sql); 
return $rs; 
}  
}


Reply via email to