cancel
Showing results for 
Search instead for 
Did you mean: 

PHP Connection strings using sasql_connect

alunrowe
Discoverer
0 Kudos

Thanks to the help here I have successfully installed the database driver and can now perform connections.

Sadly I'm not quite getting my syntax right on the connection so I need a little bit of help... 

Our server is publicly addressable (but firewall etc) and requires us to use port 2640

Initially I tried:

sasql_connect("Dbn=TestData;UID=myuser;PWD=SuperSecretPa55word;ServerName=remotehost.mycustomer.co.uk:264");

but I get the following error:

sasql_connect(): SQLAnywhere: [-100] Database server not found

I have the following connection string which I have found by searching on here and stackoverflow

sasql_connect("Dbn=TestData;Uid=myuser;Pwd=SuperSecretPa55word;CommLinks=tcpip(host‌​=remotehost.mycustomer.co.uk:2640)");

But now it gives me the following error:

sasql_connect(): SQLAnywhere: [-832] Connection error: Error in TCPIP port options

Any help gratefully received!

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member244518
Participant
0 Kudos

Hi Alun,

The connection string requires the port as a separate parameter:

sasql_connect("Dbn=TestData;Uid=myuser;Pwd=SuperSecretPa55word;CommLinks=tcpip(host​=remotehost.mycustomer.co.uk;port=2640)");

Thanks,

Mikel