If you would use xpdo-objects and methods, this should work:
if ($object = $modx->newObject($classname)){
$object->fromArray($values);
if ($object->save()){
$lastId = $object->get('id');
}
}
I think your main focus should be figuring out why your lastInsertId isn't working, as it works with
PDO::lastInsertId(). Is your table constructed out of multiple, custom primary keys, or is your table a simple xPDOSimpleObject?
@MarkGHErnst
Developer at Adwise Internetmarketing, the Netherlands.