Hi
With PHP 4.3.0 you can use --with-mssql (it looks for freetds in
/usr/local/freetds by default). Then you can use the mssql.* settings in
php.ini. When you compile using --with-sybase you would have to use the
sybase.* settings in php.ini, as that is the extension you would be
using.
You should not use ip:port as your host name. Port 1433 is the default for
both MSSQL and FreeTds. If you use any other port number you should
specify this in freetds.conf.
- Frank
Hi there,
Hope someone can help me with this.
I need to connect to a MS SQL database but my attemps fail once and
again.
This is the error message I get when try to connect:
Fatal error: Call to undefined function: mssql_connect() in
/var/www/htdocs/DB_conn.php on line 8
The script is very simple:
?php
$hostname = 10.0.0.206:1433;
$username = sa;
$password = ;
$dbName = dbname_here;
$idLink = mssql_connect($hostname,$username,$password) or die(DATABASE
FAILED TO RESPOND.);
mssql_select_db($dbName) or die(Table unavailable);
?
Now, this is the info I can provide:
1) PHP version 4.3.0-dev
2) phpinfo shows:
'./configure'
'--prefix=/usr/local'
'--enable-module=so'
'--with-mod_charset'
'--enable-sockets'
'--enable-memory-limit'
'--with-sybase=/usr/local/freetds'
3) Of course, freetds is located at /usr/local/freetds and works
properly.
It was tested using tsql -H -p -U and it's ok.
4) I also tried adding #!/usr/local/bin/php to try it as a shell
scripting
thing and it WORKS! Which is very confusing.
5) php.ini shows:
[MSSQL]
; Allow or prevent persistent links.
mssql.allow_persistent = On
; Maximum number of persistent links. -1 means no limit.
mssql.max_persistent = -1
; Maximum number of links (persistent+non persistent). -1 means no
limit.
mssql.max_links = -1
; Minimum error severity to display.
mssql.min_error_severity = 10
; Minimum message severity to display.
mssql.min_message_severity = 10
; Compatability mode with old versions of PHP 3.0.
mssql.compatability_mode = Off
; Valid range 0 - 2147483647. Default = 4096.
;mssql.textlimit = 4096
; Valid range 0 - 2147483647. Default = 4096.
;mssql.textsize = 4096
; Limits the number of records in each batch. 0 = all records in one
batch.
;mssql.batchsize = 0
; Use NT authentication when connecting to the server
mssql.secure_connection = Off
; Specify max number of processes. Default = 25
;mssql.max_procs = 25
I have no idea what the problem is; any help will be much appreciated.
-Paula
mail2web - Check your email from the web at
http://mail2web.com/ .
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php