We launched new forums in March 2019—
join us there
.
In a hurry for help with your website?
Get Help Now!
Back to MODX.com
Forums
Docs
Revo Issues
Blog
My Forums
Products
Revo Discussions & Support
Revolution 2.0
Search
Getting last inserted id?
134 Posts
itWillBeOk
Reply #1,
16 years, 5 months ago
Hi,
when in create a new Object and save it like this:
$o = $modx->newObject('smth'); $o->save();
how do i retrieve the objects database id? like mysql_insert_id? i couldn’t find anything on it for revo...
Thanks,
marc
@itWilllBeOK
MODX Staff
10,725 Posts
opengeek
Reply #2,
16 years, 5 months ago
It’s automatically updated in the object for you.
Jason Coward
Chief Architect @ MODX
http://www.jasoncoward.com
|
http://twitter.com/drumshaman
|
https://github.com/opengeek
134 Posts
itWillBeOk
Reply #3,
16 years, 5 months ago
Well, no wonder i didn’t find it myself - that was just too easy...
@itWilllBeOK