troubleshooting Question

date format not working

Avatar of peter_coop
peter_coopFlag for United Kingdom of Great Britain and Northern Ireland asked on
PHPMySQL Server
4 Comments1 Solution363 ViewsLast Modified:
i am trying to return the date in 'mm-dd-yyyy' from a mysql timstamp field 'date'. i have tried the attached code, but still displays the date in 'yyyy-mm-dd' format. any help would be great. thanks
$date = $_GET['date'];
$newdate = date("M d, Y", strtotime($date));
---------------------------------------------------
select statement
$sql = 'select service, activity, department, company, item, date, quantity, type, new'
	. ' from act '
	. ' order '
	. ' by company desc';
	$result = mysql_query($sql);
	return $result;
----------------------------------------------------------------------------------------------------------
insert statement
 
$query = 'INSERT INTO `supply` (`type`, `service`, `quantity`, `department`, `date`, `request`) VALUES (\''.$type.'\', \''.$service.'\', \''.$quantity.'\', \''.$department.'\', \''.$newdate.'\', \''.$request.'\');';
		mysql_query($query) or die(mysql_error());
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros