Recently I had to work on a project using AMFPHP and FLEX and (aaargh) MSSQL.

I am a MySQL guy but since I am working in the finance sector now, Microsoft SQL Server always comes to haunt me, but this was the first time with AMFPHP. Remember, Microsoft is good at selling their stuff to corporate. Anyway, that’s is OK if I consider I came to have nightmares working with worst things (like Sharepoint).

Anyway, for my surprise, AMFPHP adapter for Microsoft SQL didn’t work at all. I tried googling and apparently there was not that much info (no one using MSSQL with AMFPHP?). I ended up digging in the adapter files after trying everything possible and impossible.

In the end there was a “simple” bug that after fixed made everything work magically:

In the core/shared/mssqlAdapter.php file, line 28, just rename columnNames[] to columns[]

That will do it.

I contacted the AMFPHP dev team and they replied back telling me it is patched but since they have no idea when the next update is out, I should blog about it, so here it is my humble contribution :)

Tags: , , , ,

7 Responses to “AMFPHP and MSSQL”

  1. Jackson Says:

    Olá Estou trabalhando em uma aplicação com as mesmas caracteristicas e gostaria de saber se vc tem ai algum tutorial de como utilizar ou ligar o mssql ao AMFPHP talvez algum exemplo que eu possa me basear


  2. Otho Says:

    Hi, I had the same problem, but your solution was perfect.

    thx so much.

  3. Lanas Says:

    I have a similar problem but with the an odbc connection (AMFPHP 1.2.6), I´m using :

    $conn=odbc_connect(’xxx’, ”, ”);

    $sql=”SELECT * FROM table “;
    return $res;

    from the browser i can only see an empty array. From flash netDebugger i can see only the names of the table fields, nothing more. I tried your solution but it doesn’t work for me. Do you know if I have to make something special if I use the odbc, I mean using an adapter, or it’s automatic? With mysql everything worked perfect.

    Can you help me? I’m a little bit fodido…


  4. Scott Says:

    Thanks, I was just start a project using AMFPHP with MySQL and they switched to MSSQL and i hit this issue, you post help me out greatly.


  5. Saqib Ahmad Says:

    Thanks alot brother you have save lot of my time

  6. Android tablets under 500 Says:

    Thank you man, this was really useful.

  7. TexasStingray Says:

    Thanks you man. I have been looking for a fix for hours.

Leave a Reply

Socialized through Gregarious 42