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 |
Try the network server instead of the personal server, and add Host, ServerName (Server), and DatabaseName (DBN) parameters to your connection string. 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
|
Are you trying to connection to a network server or a personal server? Show us an example of your connection string.
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.