When editing and saving a node that has a dbFM attachment, the following type of error occurs:
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) FROM drupal_dbfm_attach WHERE nid = 25 AND vid = 74 ORDER BY weight' at line 1 query: SELECT COUNT (*) FROM drupal_dbfm_attach WHERE nid = 25 AND vid = 74 ORDER BY weight in /[path]/sites/all/modules/dbfm/dbfm.module on line 495.
* user warning: Duplicate entry '25-3-74' for key 'PRIMARY' query: INSERT INTO drupal_dbfm_attach (nid, fid, vid, weight) VALUES ('25', '3', '74', '0') in /[path]/sites/all/modules/dbfm/dbfm.module on line 470.

Using 6.x-1.x-dev, dated 2011-Feb-25.

Changing line 495, in dbfm.module, as shown below fixes this:
- From:
$old_count = db_result(db_query("SELECT COUNT (*) FROM {dbfm_attach} WHERE nid = %d AND vid = %d ORDER BY weight",$nid, $vid));
- To:
$old_count = db_result(db_query("SELECT COUNT(*) FROM {dbfm_attach} WHERE nid = %d AND vid = %d ORDER BY weight",$nid, $vid));

[Removed space between "COUNT" and "(*)".]

PHP 5.2.16
MySQL Community 5.1.52
CentOS 5