Re: Calling MSSQL Stored Procedure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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");

what does echo $ActualDate give you?

>     $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.

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux