Jump to content


Photo

MSSQL datetime and PHP getdate()


  • Please log in to reply
1 reply to this topic

#1 stockton

stockton
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts
  • LocationMidrand South Africa

Posted 17 January 2006 - 02:20 PM

I am attempting using the result of getdate() as a key to a MSSQL database. The MSSQL index is a SQLDATETIME.
I use :-
$StartDate = getdate();
and after connecting and selecting the database
mssql_bind($proc, "@StartDate", $StartDate, SQLDATETIME);

This fails. Is there something I need to do to the variable I get from getdate() before making the MSSQL call?


Regards,
Alf Stockton   Programmer for rent.

#2 stockton

stockton
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts
  • LocationMidrand South Africa

Posted 19 January 2006 - 11:38 AM

I found that using $Datum = date("'Y-m-d H:i:s'"); rather than getdate() worked fine.
Regards,
Alf Stockton   Programmer for rent.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users