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

PHP

Avatar of undefined
Last Comment
davecestria

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
brad2575

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
ahalya

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
EzEApostle

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
davecestria

ASKER
all examples worked fine, thanks. Splitting points.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck