I'am trying to connect to a sqlanywhere data base by using php; please I need help.

When running from command line (php connect.php) it works fine but when I try to run the same php program form a navigator (Firefox, Internet Explorer) the connexion failed.

Here are the php program I use :

With SqlAnywhere 16 (Apache 2.2.6 (Win32) and PHP 5.2.11 Data base : demo.db shiped with SqlAnywhere 16)

With SqlAnywhere 10 : (Apache 2.2.6 (Win32) and PHP 5.2.11 Data base : demo.db shiped whith SqlAnywhere 10)

basilekamdoum@yahoo.fr

asked 18 Sep '13, 17:46

basile's gravatar image

basile
16112
accept rate: 0%

1

Are you trying to connection to a network server or a personal server? Show us an example of your connection string.

(19 Sep '13, 09:48) JBSchueler
Replies hidden

Thank you for your help

I am trying to connect to a personal server (demo16.db that ship whith sa16 developer); the php script is that in SA16 documentation : <?php # Connect using the default user ID and password $conn = sasql_connect( "UID=DBA;PWD=sql" ); if( $conn ) { echo "Connected all successfullyn"; sasql_disconnect( $conn ); } else { echo "Connection failedn"; } ?>

Once more thank for help.

(19 Sep '13, 16:09) basile

Try the network server instead of the personal server, and add Host, ServerName (Server), and DatabaseName (DBN) parameters to your connection string.

permanent link

answered 20 Sep '13, 10:11

JBSchueler's gravatar image

JBSchueler
3.3k41564
accept rate: 19%

Thank you very much. The problem came from connection string; I just put parameters you advise and it works. ($conn = sqlanywhere_connect( "UID=fts;PWD=fts;ENG=GIACSRV10;CommLinks=tcpip" ));

Once more thank thank you

(20 Sep '13, 18:02) basile
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×438

question asked: 18 Sep '13, 17:46

question was seen: 2,475 times

last updated: 24 Sep '13, 11:04