Access a NF SQL-DB via PHP

Hi I have no experience with PHP. I have installed SQL Server 7 and created a NF-Database and then I imported a Backup of an existing NF-Database. I use the NF 2.60B-Client to access the SQL-DB - it works. Now my question: Is it possible to access a SQL-Server Navision-DB via PHP? If yes: How? A simple example would be nice. Thank you Ben Benjamin Crause webmaster@amargosasun.de Germany

Yes of course you can do this. follow this steps: 1. Install a ODBC Driver on your SQL Server, which link to your Navision Database. 2. Install a webserver (apache) 3. Install PHP 4.X 4 And use this script: … <?php $connect = odbc_connect("navpur","xxx","xxx"); # ODBC Driver for Navision 2.6 which was linked by the ODBC Connection if (!$connect) { echo "Connection failed!"; } # SQL Statement $query = "SELECT * FROM Customer WHERE Name = 'TEST'"; $result = odbc_exec($connect,$query); # SQL Statement ready to go ! while(odbc_fetch_row($result)){ $Cname = odbc_result($result, "Customername"); $CTel = odbc_result($result,"Customerphone"); echo ("Projektname: $Cname $CTel
"); } // close the connection odbc_close($connect); ?> I hope this short introduction can help you ! ------------ Best regards Alejandro Schubert alejandro.schubert@cycos.com

cool du kannst mir bestimmt helfen. NF mit fdb datenbank, c/odbc dsn navision in asp dB verbindung: <% strDSN = “DSN=navision2;” Set conn = Server.CreateObject(“ADODB.Connection”) conn.open strDSN %> bekomme aber fehler 80004005 unbekannter fehler bitte hilf mir danke frank mailto:f_muenchow@yahoo.de

Well, I Think there’s no need of using ODBC with SQL Server since PHP can talk nativaly with SQL Server …