dadamssg Posted March 1, 2009 Share Posted March 1, 2009 im trying to make a column that has the current datetime the row was created...this isn't working, any help would be greatly appreciated $today = time(); $cxn = mysqli_connect($host,$user,$passwd,$dbname) or die("Couldn't connect"); $sql = "INSERT INTO test (title, description,location, event, created, start, end, createdby) VALUES ('{$_SESSION['title']}','{$_SESSION['description']}','{$_SESSION['location']}' ,'{$_SESSION['event']}','{$today}', '{$_SESSION['starts']}', '{$_SESSION['ends']}', '{$_SESSION['logname']}')"; Quote Link to comment https://forums.phpfreaks.com/topic/147369-solved-how-to-enter-current-datetime/ Share on other sites More sharing options...
fenway Posted March 1, 2009 Share Posted March 1, 2009 DON'T mark topics "solved" unless you post the solution... Quote Link to comment https://forums.phpfreaks.com/topic/147369-solved-how-to-enter-current-datetime/#findComment-773704 Share on other sites More sharing options...
dadamssg Posted March 1, 2009 Author Share Posted March 1, 2009 sorry :/ $today = date("Y-m-d H:i:s"); $cxn = mysqli_connect($host,$user,$passwd,$dbname) or die("Couldn't connect"); $sql = "INSERT INTO test (title, description,location, event, created, start, end, createdby) VALUES ('{$_SESSION['title']}','{$_SESSION['description']}','{$_SESSION['location']}' ,'{$_SESSION['event']}','{$today}', '{$_SESSION['starts']}', '{$_SESSION['ends']}', '{$_SESSION['logname']}')"; Quote Link to comment https://forums.phpfreaks.com/topic/147369-solved-how-to-enter-current-datetime/#findComment-773777 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.