when adding content (node/add/article in UI) i get this error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '147' for key 'PRIMARY': INSERT INTO {node} (nid, vid, type, language, title, uid, status, created, changed, comment, promote, sticky, tnid, translate) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13); Array ( [:db_insert_placeholder_0] => 147 [:db_insert_placeholder_1] => 147 [:db_insert_placeholder_2] => article [:db_insert_placeholder_3] => fa [:db_insert_placeholder_4] => rewq [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 1354548748 [:db_insert_placeholder_8] => 1354548748 [:db_insert_placeholder_9] => 2 [:db_insert_placeholder_10] => 0 [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => 0 [:db_insert_placeholder_13] => 0 ) in drupal_write_record() (line 7114 of /var/www/vhosts/******/httpdocs/includes/common.inc).

I've read if I upgrade my php to 5.4 (from current 5.3) it will be solved Is there not any easier option? ( well it wont be easy for my upgrading php on this particular server right now)

I also changed node table structure, set vid default value from NULL to 0 ( it was mention somewhere on drupal.org) but no change

tanx in advance

  • 2
    That'a MySQL error, nothing to do with PHP...you'll receive exactly the same error no matter what version of PHP you're using. Upgrading won't fix anything. How are you adding this content, through the UI?
    – Clive
    Commented Dec 4, 2012 at 8:57
  • Also, it'd be good to check for any pending database updates (70xx) in Drupal and run them. Commented Dec 5, 2012 at 7:48


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.