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']}')"; 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... 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']}')"; 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
Archived
This topic is now archived and is closed to further replies.