We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon findFirst() return wrong data.

In my MySQL data base the latest post id is '12400445',

but when I use Post::findFirst() I got the data id is '11463656',

and I tried use Post::findFirst(12400445), it returned all the post data which id is 12400445.

So, what the problem about?

A table is unordered, you need to add ORDER BY clause to the query