[PHP] Supplied argument is not a valid MS SQL-Link resource

2001-04-14 Thread davek

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




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

2001-04-14 Thread Plutarck

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"" [EMAIL PROTECTED] wrote in message
9ba2po$jnb$[EMAIL PROTECTED]">news:9ba2po$jnb$[EMAIL PROTECTED]...
 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]