I'm new to PHP, I have no clue what I'm doing. I'm trying to perform an insert into my MSSQL database. Not really sure why this is not working.
function Register_WBG_Tester($Email, $FullName, $ChatHandle, $Product, $PreferedGenre, $PreviousTester, $AgeGroup, $PlayTime, $Discord, $NDA)
{
sqlsrv_configure('WarningsReturnAsErrors',0);
$query;
$result;
$query = (string)"
DECLARE @Response AS BIT = 0;
IF NOT EXISTS(SELECT Email FROM [dbo].[WBG_Tester] WHERE [Email] = $Email) BEGIN
INSERT INTO [dbo].[WBG_Tester]
([Email]
,[Full_Name]
,[Chat_Handle]
,[Product]
,[Prefered_Genre]
,[Previous_Tester]
,[Age_Group]
,[Play_Time]
,[Discord]
,[NDA_Agreement])
VALUES
($Email
,$FullName
,$ChatHandle
,$Product
,$PreferedGenre
,$PreviousTester
,$AgeGroup
,$PlayTime
,$Discord
,$NDA
)
SET @Response = 1
END ELSE BEGIN
SET @Response = 0
END
SELECT @Response"
$result =(bool)mssql_query($query);
return $result;
}
I've never worked with PHP before, mostly work with .Net I would prefer to exec calling a stored proc rather then string query. Any help would be great. Everything I've found was for MySQL. seems to be preferred for PHP.