Hi all,
I have a form and as part of it the date its created is uploaded too.
With that data in the database an excel file is generated and the data has to be in a certain way for their software to accept it, and one of those is the date created bit.
So in my code I am doing this:
$current_time = date ('Y-m-d H:i:s');
And its being uploaded to the database with the query below:
$sql = mysql_query("INSERT INTO hazzard (Name, Employerofperson, Contactphone, Location, DateOccured, ProductionZone, NearMissDetails, Anyimmediateactions) VALUES ('".mysql_real_escape_string($_SESSION['name_A'])."','".mysql_real_escape_string($_SESSION['companies_A'])."','".mysql_real_escape_string($_SESSION['numbers_A'])."','".mysql_real_escape_string($location)."','$current_time','$ProductionZone','".mysql_real_escape_string($detail)."','".mysql_real_escape_string($feedback)."')") or die (mysql_error());
Which gives me an output like this: 2013-08-29 16:13:31
I need to keep that as it goes, so I need to create another date created filed but htis time so that it outputs like this: 29/08/2013
With creating another field in the database to accomodate this, do I set it a certain way and how also do I create the date that way ready to go in the update script.