Calling MSSQL Stored Procedure

From: Date: Thu, 15 Sep 2005 18:19:00 +0000
Subject: Calling MSSQL Stored Procedure
Groups: php.windows 
Request: Send a blank email to php-windows+get-26331@lists.php.net to get a copy of this message
I have to access a MsSQL stored procedure coded as follows :- CREATE PROCEDURE spGetActivePromotions @Today datetime AS SELECT PromotionID, PromotionName, StartDate, EndDate, LastDrawDate,
      MaxDraws, NumRegTickets, VouchersPermitted, NumTicketsPerVoucher, ManualTicketIssue
FROM Promotion WHERE @Today>=StartDate AND @Today<=EndDate GO and therefore have coded my php as follows :- $PMdriver = "mssql"; $PMdb = ADONewConnection($PMdriver); $PMdb->Connect($PMserver, $PMuser, $PMpassword, $PMdatabase); $SQL = $PMdb->Prepare("spGetActivePromotions"); $ActualDate = strftime("%Y/%m/%d %I:%m:%S %p"); $PMdb->InParameter($SQL, $ActualDate, "Today"); $PMdb->OutParameter($SQL, $ret, 'RETVAL'); but I keep getting the error message 201: Procedure 'spGetActivePromotions' expects parameter '@Today', which was not supplied. Please tell me how I got this wrong.

« previous php.windows (#26331) next »