Jump to content

Connecting to remote server/sage using php?


MercJones

Recommended Posts

Hi there.

 

Unsure this is the correct place, but it was this or another database one and I wasnt sure. anyway..

 

Just wondering if any of you have any suggestions/experience on connecting to sage using php.

 

I know you need the odbc extension, which ive added to php.ini, and then ive done sudo aptitude install php5-odbc, which phpinfo() has picked up, but im trying to connect and get:

 

SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect

 

so I dont know if I need another driver or whatever?

 

Also, i read you may need to edit odbc.ini in /etc/ this exists but is empty.

 

The problem gets worse becuase you normally use code similar to:

 

<?php

$rConn = odbc_connect("SageLine50V10", "user", "pass");

 

$rRes = odbc_tables($rConn);

 

odbc_result_all($rRes);

odbc_close($rConn);

?>

 

but we want to connect to a remote IP, instead of one on the same server running php.

 

Any ideas please?

 

Cheers

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.