Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » Incorrect Autoinsert of created_date and created_user
Incorrect Autoinsert of created_date and created_user [message #2192] Tue, 07 July 2009 09:09 Go to previous message
divico is currently offline  divico
Messages: 13
Registered: August 2008
Junior Member
Hi,
I get the following error:

Fatal Error: MySQL error: 1054 - Unknown column 'created_date' in 'field list' (# 1054).

SQL query: INSERT INTO spill_file SET ..., created_date='2009-07-07 13:24:26', created_user='...'

Error in line 866 of file '...\radicore\includes\dml.mysqli.class.inc'.

Error occurs in method insertRecord. As I could see the original $fieldarray passed to insertRecord is expanded through the foreach loop commented as "look for fields with 'autoinsert' option set". At runtime $this->fieldspec looks as follows:

Variable: fieldspec: (array)
Key: language_id Value: Array
Key1: type Value1: string
Key1: size Value1: 5
Key1: pkey Value1: y
Key1: required Value1: y
Key1: default Value1: EN
Key1: uppercase Value1: y
Key1: control Value1: dropdown
Key1: optionlist Value1: language_id
Key: language_name Value: Array
Key1: type Value1: string
Key1: size Value1: 40
Key1: required Value1: y
Key1: default Value1: English
Key1: nodisplay Value1: y
Key: created_date Value: Array
Key1: type Value1: datetime
Key1: size Value1: 20
Key1: required Value1: y
Key1: default Value1: 2000-01-01 00:00:00
Key1: autoinsert Value1: y
Key1: noedit Value1: y
Key1: nosearch Value1: y
Key: created_user Value: Array
Key1: type Value1: string
Key1: size Value1: 16
Key1: default Value1: UNKNOWN
Key1: autoinsert Value1: y
Key1: noedit Value1: y
Key1: nosearch Value1: y
Key: revised_date Value: Array
Key1: type Value1: datetime
Key1: size Value1: 20
Key1: autoupdate Value1: y
Key1: noedit Value1: y
Key1: nosearch Value1: y
Key: revised_user Value: Array
Key1: type Value1: string
Key1: size Value1: 16
Key1: autoupdate Value1: y
Key1: noedit Value1: y
Key1: nosearch Value1: y

The table I'm adding to is kind of a temporary nature and I do not have defined any of those columns. The error is caused by adding created_date and created_user to $fieldlist, which is not a defined column in my table.
I'm running version 1.48 and my last successful use of this function is probably a couple of months back. I added quite a few releases in between.

Kind regards, Divico
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Small bug in include.xml.php5.inc
Next Topic: New Hosting Account Bug
Goto Forum:
  


Current Time: Tue May 17 02:59:04 EDT 2022

Total time taken to generate the page: 0.01765 seconds