BlackLava Posted January 29, 2008 Share Posted January 29, 2008 Hi I got a problem connecting to ms sql server 2000 from php using odbc. My server tech installed for me freetds... Here is what I have : Error message : Warning: odbc_connect() [function.odbc-connect]: SQL error: [FreeTDS] Read from SQL server failed., SQL state 08S01 in SQLConnect in... DSN in odbc.conf : [MSSQL] Driver = /usr/local/freetds/lib/libtdsodbc.so Description = MSSQL Trace = No Server = 208.99.194.130 Database = ProWagSys Port = 1433 Php code : putenv('ODBCINI=/....Path..../odbc.conf'); $username="xxxx"; $password="xxxxxxxxxxxx"; $sqlconnect=odbc_connect("MSSQL",$username,$passwo rd); The path to odbc.conf is right, username & password too, no problem there. Please help me, starting to make me crazy Guy Quote Link to comment https://forums.phpfreaks.com/topic/88400-problem-connecting-to-sql-server-from-php/ Share on other sites More sharing options...
BlackLava Posted January 29, 2008 Author Share Posted January 29, 2008 *Bump* sorry don't want to abuse but I've tried all day long and still can't fix that... I don't even know if the issue come from the sql server or from my linux server setup (both servers are mine btw, can change things on both sides) Quote Link to comment https://forums.phpfreaks.com/topic/88400-problem-connecting-to-sql-server-from-php/#findComment-452960 Share on other sites More sharing options...
siapagweh Posted February 16, 2008 Share Posted February 16, 2008 <? $server = "SERVER_ADDRESS"; $user = "***"; $password = "***"; $con = mssql_connect($server, $user, $password); if(!$con){ die("error Connecting to server "); } mssql_select_db("dbname", $con); ?> for the others wuery on db, using same as mysql mssql_query mssql_fetch_array etc... chek on php.net Quote Link to comment https://forums.phpfreaks.com/topic/88400-problem-connecting-to-sql-server-from-php/#findComment-468195 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.