Re: Supplied argument is not a valid MS SQL-Link resource

From: Date: Sat, 14 Apr 2001 18:15:50 +0000
Subject: Re: Supplied argument is not a valid MS SQL-Link resource
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-48571@lists.php.net to get a copy of this message
http://us.php.net/manual/en/function.mssql-select-db.php *_select_db does not return a connection id, it returns true or false. Just change your script like this: $Conn=mssql_connect('192.168.1.20','username','password'); mssql_select_db('My_Database',$Conn); $QueryString="select id, name from my_table"; $Test=mssql_query($QueryString, $Conn); That should work just fine. -- Plutarck Should be working on something... ...but forgot what it was. ""davek"" <dkrewet@rw3.com> wrote in message news:9ba2po$jnb$1@toye.p.sourceforge.net... > Does anybody know how to fix this error? "Supplied argument is not a valid > MS SQL-Link resource" I am running: > > NT4 > MSSQL7.0 > IIS4 > PHP 4.0.4pl1 > > I've been running php3 for some time now without any problems but want to > upgrade to 4. This error seems to be occuring at the mssql_query() > function. > > $Conn=mssql_connect('192.168.1.20','username','password'); > $ThisConnect=mssql_select_db('My_Database',$Conn); > $QueryString="select id, name from my_table"; > $Test=mssql_query($QueryString, $ThisConnect); > > Please help! Thanks. > Dave > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#48571) next »