I am having this store procedure on mssql
alter procedure loginmember
@user varchar(100),
@pass varchar(100)
as
set nocount on
if exists (select 1 from member where username=@user and pass=@pass)
begin
select 1 as res
update memberStatus set isLogin=1 where username=@user
end
else
begin
select 0 as res
end
set nocount off
and the table are member (having username and password field) an memberStatus (username, isLogin -int-)
my query is exec loginmember 'admin','asdasdasd'
in mssql and java,, the isLogin was change from 0 to 1,, but not in the php
here the php code
$sql="exec loginmember '".$_POST['Username']."','".$_POST['password']."'";
$result=sqlsrv_query($conn, $sql);
if($result){
$row = sqlsrv_fetch_array($result, SQLSRV_FETCH_NUMERIC);
if($row[0]===1){
$redirect=true;
} else {
$wrongPass=true;
}
}
I've got no problem with connection and the $redirect was change to true, but isLogin not updated... somebody please help me...