Dates coming up blank when inserting new records

3 posts by 2 authors in: Forums > CMS Builder
Last Post: January 23, 2019   (RSS)

By gkornbluth - January 23, 2019

Hi All,

I’m using, the script below (with many text fields left out) to create new records in the table 'listen_live', and it creates a record, but when I look at the record or the database table, dates like createdDate and updatedDate are coming up blank. (0000-00-00 00:00:00 in the database table). I also tried curdate() and CURRENT_TIMESTAMP().

Any thoughts?

Thanks,

Jerry Kornbluth

<?php
mysqlStrictMode(false);
$tablename = 'listen_live';
$colsToValues = array();
$colsToValues['hidden'] = 0;
$colsToValues['createdDate'] = 'NOW()';
$colsToValues['updatedDate'] = 'NOW()';
$colsToValues['time'] = "7:00 to 10:00 PM";
$newRecordNum = mysql_insert($tablename, $colsToValues, true);
?>

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By gkornbluth - January 23, 2019

Hi Daniel,

It's so easy when you know how...

Thanks for the solution.

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php