|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43110 MSSQL_BIND won't work with datetime parameter
Submitted: 2007-10-26 20:05 UTC Modified: 2013-10-15 11:54 UTC
Avg. Score:4.9 ± 0.3
Reproduced:12 of 12 (100.0%)
Same Version:8 (66.7%)
Same OS:7 (58.3%)
From: lhelmer at suezenergyna dot com Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 5.2.4 OS: Win2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: lhelmer at suezenergyna dot com
New email:
PHP Version: OS:


 [2007-10-26 20:05 UTC] lhelmer at suezenergyna dot com
I'm trying to execute a MSSQL stored procedure from PHP and I need to pass a datetime parameter... when I do this the sp fails.

My bind statement is as follows

In a different situation I pass an integer parameter and that sp works. That bind statement is as follows

I know my stored procedure "CalculateDailyTotals" works because I use them everday in a scheduled job. It seems the problem is related to passing a datetime value to the stored procedure.

Reproduce code:
$RecDate=$_POST['RecalcDate']; // RecalcDate = 2007-10-25

$db = mssql_connect("***","sa","***") or die("Unable to connect to server");
$proc = mssql_init("CalculateDailyTotals", $db);

$Result = mssql_execute($proc);
if ($Result == 1){
echo "Succes";
} ELSE {
echo "Failure";

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-21 22:36 UTC] leo dot avatar at hoptmail dot com
execute stored procedure of mssql server with php5 using parameters type datetime
 [2013-08-02 00:35 UTC]
-Status: Open +Status: Feedback
 [2013-08-02 00:35 UTC]
Please try using this snapshot:
For Windows:

 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 07:01:30 2024 UTC