|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-01-21 22:36 UTC] leo dot avatar at hoptmail dot com
[2013-08-02 00:35 UTC] yohgaki@php.net
-Status: Open
+Status: Feedback
[2013-08-02 00:35 UTC] yohgaki@php.net
[2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 13:00:02 2025 UTC |
Description: ------------ 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 mssql_bind($proc,"@RequestDate",$RecDate,SQLVARCHAR,false,false,10); In a different situation I pass an integer parameter and that sp works. That bind statement is as follows mssql_bind($proc,"@Load",$MWLoad,SQLVARCHAR); 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"); mssql_select_db("Reporting"); $proc = mssql_init("CalculateDailyTotals", $db); mssql_bind($proc,"@RequestDate",$RecDate,SQLVARCHAR,false,false,10); $Result = mssql_execute($proc); if ($Result == 1){ echo "Succes"; } ELSE { echo "Failure"; } Expected result: ---------------- Success Actual result: -------------- Failure