hello everybody:
Here's the situation. I've created this trouble-ticket posting system, where a user submits a problem to our glorious hr department, and while doing so, a "time posted" variable is submitted using this code:
Code: Select all
<?PHP
$ue_today = mktime(date("G"), date("i"), date("s"), date("m"), date("d"), date("Y"));
$timeposted = date ("Y-m-d G:i:s", $ue_today);
?>
into a datetime field. I use the variable $timeposted as a unique identifier, so our hr guy and update each ticket from "unanswered" to "in progress" to "resolved" blah blah. I'm sure you get the idea. Anyway, the problem is, the update query isn't working, and I think it has to do with the way I'm handling the date or strtotime part. The date (which I modified to make it a little more readable) originally comes over in this format: Jan 18, 4:13:34 pm to this php code:
Code: Select all
<?PHP
$timeposted = $_POST['timeposted'] ;
//code here, etc..
$timeposted = date ("Y-m-d G:i:s", strtotime($timeposted));
// update query here
?>
This has got to be wrong somewhere, because it echos -1, which would mean the string is bad according to the manual, right? I've also tried screwing around with it, and
Code: Select all
$timeposted = date("Y-m-d g:i:s", $timeposted) ;
echos the old 1969-12-31 6:00:00 treatment. It's probably staring me in the face, but any help or advice would be helpful.
hope all is well. holy crap, sorry this is so long.