Link to home
Create AccountLog in
Avatar of davecestria
davecestria

asked on

PHP: Insert Date Into MSSQL DB

Hello Experts,

Very simple... i would like to enter the current date & time into my MS SQL DB, Field: LastMapUpdate using PHP.

My existing code is below, please advise how to modify for the desired results.

Thanks in advance.
$sql = sprintf("UPDATE Routes SET EstDistance=%f, EstHours=%d, " .
			"EstMins=%d, FinishDate='%s', FinishTime='%s', ReMap=0 WHERE ID=%d",
			$cmdObject->totaldist, $cmdObject->totalhours, $cmdObject->totalmins,
			$runfinishdate, $cmdObject->runfinishtime, $cmdObject->runid);
		$res = $MyDB->ExecQuery($sql);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of brad2575
brad2575
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of davecestria
davecestria

ASKER

all examples worked fine, thanks. Splitting points.