Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-21 Thread Alf Stockton
Robert Twitty wrote: The ODBTP package includes 2 versions of php_odbtp.dll. One for PHP4 and the other for PHP5. You need to place the correct php_odbtp.dll file in the same directory where php_mssql.dll and the other extensions are located. For PHP4, this should be php\extensions, and php\e

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-21 Thread Alf Stockton
Robert Twitty wrote: The ODBTP package includes 2 versions of php_odbtp.dll. One for PHP4 and the other for PHP5. You need to place the correct php_odbtp.dll file in the same directory where php_mssql.dll and the other extensions are located. For PHP4, this should be php\extensions, and php\e

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-20 Thread Alf Stockton
Robert Twitty wrote: The code will generate a blank screen if there are no reesults returned by the stored procedure. Have you verified that the query performed by the stored procedure will generate a result set for the current time? To verify this, use strtotime( "-MM-DD HH:MM:SS" ) instead

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-20 Thread Robert Twitty
IF the "echo $ActualDate" is not displaying, then is it possible that the script is terminating before that statement? Also, to make sure your ODBTP setup is working properly, run the following code after connecting: $rs = $DB->Execute( "SELECT * FROM AnyTable" ); if( !$rs ) { pri

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-20 Thread Robert Twitty
The code will generate a blank screen if there are no reesults returned by the stored procedure. Have you verified that the query performed by the stored procedure will generate a result set for the current time? To verify this, use strtotime( "-MM-DD HH:MM:SS" ) instead of time(). Make sure yo

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-20 Thread Alf Stockton
Robert Twitty wrote: Hi Alf Based on a previous posting, the code for the stored procedure spGetActivePromotions does not return a value. Therefore, $ret is going to be undefined. The procedure returns a result set that you must iterate via $rs: while (!$rs->EOF) { print_r($rs->field

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-19 Thread Robert Twitty
Hi Alf Based on a previous posting, the code for the stored procedure spGetActivePromotions does not return a value. Therefore, $ret is going to be undefined. The procedure returns a result set that you must iterate via $rs: while (!$rs->EOF) { print_r($rs->fields); $rs->MoveN

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-19 Thread Alf Stockton
Robert Twitty wrote: Since you are using php_mssql.dll, you should use php_odbtp.dll instead of php_odbtp_mssql.dll to prevent namespace conflicts. The ADODb driver name is 'odbtp', and the database connection should be performed similar to the following: $db = NewADOConnection('odbtp');

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-19 Thread Robert Twitty
Since you are using php_mssql.dll, you should use php_odbtp.dll instead of php_odbtp_mssql.dll to prevent namespace conflicts. The ADODb driver name is 'odbtp', and the database connection should be performed similar to the following: $db = NewADOConnection('odbtp'); // Connect to databas

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-18 Thread Alf Stockton
Robert Twitty wrote: Hi Alf The ODBTP client works on all platforms. It includes a Win32 PHP extension (php_odbtp.dll). If you install it, you may find that it will produce better reslts than the packaged mssql extesnion under Windows. The reason is because the PHP win32 mssql extension was b

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-17 Thread Robert Twitty
Hi Alf The ODBTP client works on all platforms. It includes a Win32 PHP extension (php_odbtp.dll). If you install it, you may find that it will produce better reslts than the packaged mssql extesnion under Windows. The reason is because the PHP win32 mssql extension was built with DB-Library, wh

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-17 Thread Alf Stockton
Robert Twitty wrote: First, you should be using PrepareSP() instead of Prepare() to call a stored procedure. Second, the PHP mssql extension does not appear to be able to bind directly to a datetime parameter. If you cannot rewrite the procedure, then you should install the odbtp extension (ht

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Robert Twitty
First, you should be using PrepareSP() instead of Prepare() to call a stored procedure. Second, the PHP mssql extension does not appear to be able to bind directly to a datetime parameter. If you cannot rewrite the procedure, then you should install the odbtp extension (http://odbtp.sourceforge.n

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Kevin Smith
Hi, Have you tried using the SQL Profiler??? This can output everything that happens on the SQL Server, and specifically only output data on SPs that execute. So, if you put a print command inside your SP which prints the date that it "should" be receiving, you may be able to work out of it i

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Mark Rees
> > > >The type problem in not in PHP but in SQL Server. The sp expects an input > >parameter of type datetime, and it isn't getting one. > > > >http://www.php.net/function.mssql-query has the answer to this question, > >which is to supply the parameter as varchar and use CONVERT in the sp to > >ch

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Alf Stockton
The other programs I spoke of in my earlier email that are already using that sp are written in C# not php. -- Regards, Alf Stocktonwww.stockton.co.za Give him an evasive answer. My email disclaimer is available at www.stockton.co.za/disclaimer.html -- PHP Windows Mailing List (h

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Alf Stockton
Mark Rees wrote: The type problem in not in PHP but in SQL Server. The sp expects an input parameter of type datetime, and it isn't getting one. http://www.php.net/function.mssql-query has the answer to this question, which is to supply the parameter as varchar and use CONVERT in the sp to ch

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Mark Rees
> > Mark Rees wrote: > > > >>> > >>> I get 2005/09/16 10:09:22 AM which is exactly the same format as it > >>> appears in the database table when viewed via Enterprise Manager. > >>> > >> > >> > >> I wouldn't set too much store by how it looks in EM. It is a datetime > >> value, > >> so its interna

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Alf Stockton
M. Sokolewicz wrote: Alf Stockton wrote: Mark Rees wrote: I get 2005/09/16 10:09:22 AM which is exactly the same format as it appears in the database table when viewed via Enterprise Manager. I wouldn't set too much store by how it looks in EM. It is a datetime value, so its intern

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread M. Sokolewicz
Alf Stockton wrote: Mark Rees wrote: I get 2005/09/16 10:09:22 AM which is exactly the same format as it appears in the database table when viewed via Enterprise Manager. I wouldn't set too much store by how it looks in EM. It is a datetime value, so its internal representation will b

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Mark Rees
> >>I get > Please suggest what data type you would use. In the database the > requisit field is a datetime but I cannot find in either adodb or php > document a datetime type. I suggest you augment your research with google: http://www.google.co.uk/search?hs=tAt&hl=en&client=firefox-a&rls=org.

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Alf Stockton
Mark Rees wrote: I get 2005/09/16 10:09:22 AM which is exactly the same format as it appears in the database table when viewed via Enterprise Manager. I wouldn't set too much store by how it looks in EM. It is a datetime value, so its internal representation will be quite different. It

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Mark Rees
> > >>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, > >

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Alf Stockton
Mark Rees wrote: 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, ManualTicketIss

[PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread Mark Rees
> 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