我有一个插入查询,我想从表中获取ID。我一直在搜索,我找到了PDO的lastInsertId()。当我想使用它时,出现PHP错误。这是我的代码:$db=newdatabase();$naam=$db->quoteQuery($_POST['naam']);$barcode=$db->quoteQuery($_POST['barcode']);$sql="INSERTINTOproducts(name,barcode)VALUES(".$name.",".$barcode.")";$results=$db->executeQuery($sql);$lastid=$results->las