PHP: Inserting the current timestamp into SQL Server 2005


Question

How do I insert a current_timestamp into an SQL Server 2005 database datable with a timestamp column?

It should be simple but I cannot get it to work. Examples would be much appreciated.

1
8
4/4/2014 1:45:32 PM

if you can execute a query from PHP then it should just be a matter of using 'getdate()' ;

update MyTable set MyColumn=getdate();

or

insert into MyTable (MyColumn) values (getdate());
9
4/4/2014 1:46:10 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon