I am trying to update two tables (REQUISITION & STOCK) and subtract two column from both the table by using inner join on SQL Server. I've tried this and it doesn't work out.
<?php
$tsql = "UPDATE [MRS].[dbo].[REQUISITION] A
INNER JOIN [MRS].[dbo].[STOCK] B
ON B.StockId = A.StockId
SET A.RequestStatus = 'APPROVED',
A.ApprovedDate = CONVERT(VARCHAR(10),
GETDATE(),103),
B.StockQuantity = B.StockQuantity - A.RequestQuantity
WHERE RequestId = '$_GET[RequestId]'";
$result = sqlsrv_query($conn, $tsql, array(),
array ("Scrollable" => SQLSRV_CURSOR_KEYSET));
header('Location:approval.php');
?>