Jump to content

problems with stored proc mssql


fogofogo

Recommended Posts

Hello

 

I' having problems called a mssql stored proc with the following code...

 

 

$myServer = "SERVER";
$myUser = "USER";
$myPass = "PASS";
$myDB = "DB"; 

//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
  or die("Couldn't connect to SQL Server on $myServer"); 

//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn't open database $myDB"); 

// call my proc fromhere
function loginUser($alias, $password)
{
$proc = mssql_init('sp_CheckUserExists',$selected);

mssql_bind($proc,'@Alias',$alias,SQLVARCHAR);
mssql_bind($proc,'@Password',$password,SQLVARCHAR);


if ($result = mssql_execute($proc)) 

{	if ($row = mssql_fetch_row($result)) 	

		{		// action	
		}

}	

 

And here are the erros I am getting....

 

Warning: mssql_init(): supplied argument is not a valid MS SQL-Link resource in Functions.php on line 70

 

Warning: mssql_bind(): supplied argument is not a valid MS SQL-Statement resource in Functions.php on line 72

 

Warning: mssql_execute(): supplied argument is not a valid MS SQL-Statement resource in Functions.php on lin

 

 

Anyone know what theses errors are?

 

THanks!

Link to comment
https://forums.phpfreaks.com/topic/205053-problems-with-stored-proc-mssql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.