Update_date field type not sending current time

errolsirra

New member
I am running Dadabik v4.0 on two separate websites running MySQL 4.1.21 and PHP 4.4.4. For most of the tables I setup I have a primary index set to datetime in MySQL and set this field as update_date in Dadabik (only displaying in details page). On one website I have no problems and can enter multiple records on the same day. When I view the table in phpMyAdmin this datetime field has the date and current time set.

On the second website I recently setup I receive the following error after entering a second record on the same day:

[08] Error: during query execution.
INSERT INTO `bnl_welcome` (`dept`, `welcome_text`, `on_off`, `welcome_index`) VALUES ('Youth Services', 'youth text', 'on', '2007-03-29')
DBMS server said: Duplicate entry '2007-03-29 00:00:00' for key 1

The problem seems clear, that only the date portion is being sent during INSERT and the time is automatically being set to midnight. When I attempt to enter a second record on the same day it will obviously see it as a duplicate primary key and fail. My question is why is this happening for this install but my other nearly identical install doesn't have a problem sending the time for update_date.

The $date_format is set to 'literal_english' in config.php. All other settings are basically the default settings.

 

DebbieS

DaDaBIK Guru
Are both sites on the same server? If they are on separate servers, perhaps there is some setting on the server which is preventing the time from being set? Are the settings for the field EXACTLY the same on both (directly at the DB side)? If the php files are essentially the same for each installation, then the problem points to the back-end (either server or DB problem) and nothing related to DaDaBIK.

 

errolsirra

New member
I think you may be right. My initial suspicion was the PHP install since I had to get the web hoster to change some settings in this file before installing Dadabik (phpinfo is seemingly identical now though). I just wanted to be sure there wasn't any problem with the way Dadabik was doing the insert for the update_date field type. Thanks for the help.
 
Top