Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findOrCreate string viewed as int #525

stijnboa opened this issue Sep 26, 2016 · 2 comments

findOrCreate string viewed as int #525

stijnboa opened this issue Sep 26, 2016 · 2 comments


Copy link

$m = \R::findOrCreate('category', ['code' => (string)$me->menuid]);

// the value of $me->menuid => '00000'

results in query:
SELECTcategory.* FROMcategoryWHERE (codeIN ( 00000 ) )

Which returns all rows where a string is filled in (searches for integer 0)

To fix this the resulting query should be (quotes):

SELECTcategory.* FROMcategoryWHERE (codeIN ( '00000' ) )

Redbean version 4.3

Copy link

Thank you for reporting this issue.
I will look into this.

Copy link

stijnboa commented Oct 4, 2016


dv336699 pushed a commit to dv336699/redbean that referenced this issue Nov 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants