Search code examples
phpdrupaldrupal-7

Drupal: Exception 'PDOException' with message 'SQLSTATE[01000]: Warning: 1265 Data truncated for column 'created'


I am programming a PHP Script to insert content into my portal with a excel file. I'm using Drupal. But it is showing an error when I tried to do so, while inserting into taxonomies.

I think that, it produced by taxonomies.

The error I found is:

    exception 'PDOException' with message 'SQLSTATE[01000]: Warning: 1265 Data truncated for column 'created' at row 1' in /home/anetor5/public_html/ogobdev2/includes/database/database.inc:2168 Stack trace: 

#0 /home/anetor5/public_html/ogobdev2/includes/database/database.inc(2168): PDOStatement->execute(Array) 
#1 /home/anetor5/public_html/ogobdev2/includes/database/database.inc(680): DatabaseStatementBase->execute(Array, Array) 
#2 /home/anetor5/public_html/ogobdev2/includes/database/mysql/query.inc(36): DatabaseConnection->query('INSERT INTO {ta...', Array, Array) 
#3 /home/anetor5/public_html/ogobdev2/modules/taxonomy/taxonomy.module(1970): InsertQuery_mysql->execute() 
#4 /home/anetor5/public_html/ogobdev2/modules/taxonomy/taxonomy.module(1903): taxonomy_build_node_index(Object(stdClass)) 
#5 [internal function]: taxonomy_node_insert(Object(stdClass)) 
#6 /home/anetor5/public_html/ogobdev2/includes/module.inc(857): call_user_func_array('taxonomy_node_i...', Array) 
#7 /home/anetor5/public_html/ogobdev2/modules/node/node.module(1185): module_invoke_all('node_insert', Object(stdClass)) 
#8 /home/anetor5/public_html/ogobdev2/scriptInsercion.php(367): node_save(Object(stdClass)) 
#9 /home/anetor5/public_html/ogobdev2/scriptInsercion.php(104): crearNodo(Array) 
#10 {main}

How can I solve it??


Solution

  • The error explaining you that, the size of the data for the column in the table is exceeded, so that data is truncated.

    generally the column created stores unix timestamp when it was created. Make sure you have proper data for the column in the excel file.