Sudantha Posted May 22, 2010 Share Posted May 22, 2010 Guys i need to get the return value from this code how to do it ? CREATE PROC getLogin @username varchar(50),@password varchar(50) AS if exists (SELECT * FROM Operator WHERE Call_ID=@username AND PASSWORD=@password) BEGIN return 1 END else return 0 MY php code is following $stmt=mssql_init('getLogin',$connection); mssql_bind($stmt,"@username",&$uid,SQLVARCHAR,false,true,60); mssql_bind($stmt,"@password",&$password,SQLVARCHAR,false,true,60); $result=mssql_execute($stmt); $arr=mssql_fetch_row($result); Quote Link to comment https://forums.phpfreaks.com/topic/202568-mssql-stored-procedure-problem/ Share on other sites More sharing options...
rapa Posted May 24, 2010 Share Posted May 24, 2010 Try like this CREATE PROC getLogin @username varchar(50),@password varchar(50) AS SET @user = (SELECT * FROM Operator WHERE Call_ID=@username AND PASSWORD=@password) if exists (@user) BEGIN RETURN @user END else return 0 Quote Link to comment https://forums.phpfreaks.com/topic/202568-mssql-stored-procedure-problem/#findComment-1062618 Share on other sites More sharing options...
Sudantha Posted May 25, 2010 Author Share Posted May 25, 2010 Try like this CREATE PROC getLogin @username varchar(50),@password varchar(50) AS SET @user = (SELECT * FROM Operator WHERE Call_ID=@username AND PASSWORD=@password) if exists (@user) BEGIN RETURN @user END else return 0 thanks rapa ! ,, i got a solution but donno is this the best method http://sudantha.wordpress.com/2010/05/25/running-microsoft-sql-mssql-stored-procedures-in-php/ Quote Link to comment https://forums.phpfreaks.com/topic/202568-mssql-stored-procedure-problem/#findComment-1062892 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.