Navision 2.01 and PHP

I’m new in this forum. It looks great !! Well. I’ve seen several questions regarding on PHP access to NF. All topics I have seen talk about SQL Server … Well. I don’t have SQL Server. So my question is : ¿ Is it possible to connect to NF 2.01 on NT with its own Database Engine from Linux using PHP ? ¿ Any one has done it succesfully ? Thanx.

Yep, its possible and very simple. I tried it with a apache server and PHP 3.0 First you need to install the ODBC Driver from Navision and create a Driver. Now you need a PHP 3 Script. Here an very simple example: <?php $connect = odbc_connect(ODBCDriverName,Login,password"); # ODBC Driver to Navision 2.6 $query = "SELECT elefant FROM arica WHERE x = '$foo'"; $result = odbc_exec($connect,$query); # Start SQL Statement while(odbc_fetch_row($result)){ $xx = odbc_result($result, "field1"); $yy = odbc_result($result,"field9"); print(" $xx $yy \n
"); } // close the connection odbc_close($connect); ?> ------------------ Best regards Alejandro Schubert CYCOS AG System Engineer www.cycos.com www.dolphinct.de EMail: Alejandro.Schubert@cycos.com

I thought so but … My PHP doesn’t reconize odbc-connect … How did you get PHP working with odbc ?? And, please, could you tell me how configure odbc driver on NT machine ?? Very, very thanx.

I will send you a Email … ------------------ Best regards Alejandro Schubert CYCOS AG System Engineer www.cycos.com www.dolphinct.de EMail: Alejandro.Schubert@cycos.com

Hi nyman and Alex I tried to connect via PHP and ODBC to Navision. I have a Apache-Server with PHP running. But either I got Error-Messages about parser oder not recognized ODBC-Driver. I installed NF’s ODBC-Driver (NF2.01A+B) and created: - a User Data Source called BENPHP - System Data Source also called BENPHP - and a File DSN Entry in “Data Sources” called BENPHP.dsn My C/ODBC Driver is Version 2.11.02.1507 CODBC.dll from the 09-02-1999 Any suggestions? I didnt find the problem with the PHP-Help-Tutorials. Best regards Benjamin Benjamin Crause webmaster@amargosasun.de Germany

Hi, Alex. You said me at navision forum you can connect to navision own db engine using PHP3. Well, I’m getting crazy trying connectting to … My problem is my PHP doesn’t recognize odbc_connect. I’ve tried to compile PHP and Apache with odbc support but with no success. Please, do you know something about this ? How can I get PHP running in Linux with odbc support ??? Thanx. Please, reply to cnovo@icasociados.com too.