# \[GELÖST\] insert\_id

**URL:** <https://forum.shopware.com/t/gelost-insert-id/10576>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [20. Dezember 2012 um 13:18 UTC](https://forum.shopware.com/t/gelost-insert-id/10576 "2012-12-20T13:18:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecomai](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@ecomai](https://forum.shopware.com/u/ecomai)\
**Post date:** [20. Dezember 2012 um 13:18 UTC](https://forum.shopware.com/t/gelost-insert-id/10576/1 "2012-12-20T13:18:12Z")

</div>

Wie bekomme ich zu einem per `Shopware()-\>Db()-\>query($sql,$params);` eingefügten Datensatz die id unter der der Eintrag hinzugefügt wurde?

---

<div class="post-metadata">

**Author:** ![teapavillion](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@teapavillion](https://forum.shopware.com/u/teapavillion)\
**Post date:** [4. Januar 2013 um 10:11 UTC](https://forum.shopware.com/t/gelost-insert-id/10576/2 "2013-01-04T10:11:47Z")

</div>

Hiermit: [quote]$id = Shopware()-\>Db()-\>lastInsertId();[/quote]
