Frank Vèssia Posted December 6, 2012 Share Posted December 6, 2012 Hello, how can I get the latest comment ID after his creation? $commentPage->comment->add($c); if ($commentPage->save('comment')){ // get comment id } Link to comment Share on other sites More sharing options...
diogo Posted December 6, 2012 Share Posted December 6, 2012 $commentPage->comment->last()->id ? Link to comment Share on other sites More sharing options...
Frank Vèssia Posted December 6, 2012 Author Share Posted December 6, 2012 it doesn't work Link to comment Share on other sites More sharing options...
Frank Vèssia Posted December 7, 2012 Author Share Posted December 7, 2012 Got it, it's first() not last() Link to comment Share on other sites More sharing options...
diogo Posted December 7, 2012 Share Posted December 7, 2012 ok I didn't test it and wasn't sure... you look different suddenly... 1 Link to comment Share on other sites More sharing options...
ryan Posted December 7, 2012 Share Posted December 7, 2012 Got it, it's first() not last() I think this depends what sorting is used on the comments. Link to comment Share on other sites More sharing options...
diegonella Posted January 5, 2013 Share Posted January 5, 2013 and... $commentPage->comment->add($c); if ($commentPage->save('comment')){ echo $commentPage->id; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now