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

I find a bug findFirstByUserid()

when my id is 15080316325440044460 but 1508031632544004446011212 also can be found as data



20.4k
edited Nov '15

Did it find 15080316325440044460? That would be expected as you stipulated findFirst and as the lower number, that would be found first. Or did something else happen?



1.0k

Does it find the expected one when you try findByUserid()?



27.0k
edited Nov '15

when I findFirstByUserid(15080316325440044460) and it can find the true data . but when my table no 15080316325440044460 and instead 15080316325440044460333 note last no matter what I add it can be find as findFirstByUserid(15080316325440044460) result, my Userid is char 20



20.4k

What is the column data type for the Userid ?



20.4k
Accepted
answer
edited Nov '15

So the ID 15080316325440044460 is 20 chars. 15080316325440044460333 is 23 chars (to long), so it gets truncated to 20 chars which leaves 15080316325440044460. So when you do findFirstByUserid(15080316325440044460333) the 333 is ignored from the query. You could try setting the column data type to char 23 or bigint etc.



27.0k

thanks ,unreasonable