countOwn() raises an exception if the table does not exists

30 views
Skip to first unread message

Benoit Pruneau

unread,
Mar 13, 2021, 12:16:32 PM3/13/21
to redbeanphp
Normally, if the table "Member" exists, the two following lines returns the same result, that is the number of members in a category.
print count($category->withCondition('active=1')->{'ownMemberList'});
print $category->withCondition('active=1')->countOwn('member');
But if the table named "Member" does not exists, the first line prints zero (as expected), but the second raises an exception "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'member' doesn't exist".

Ben Major

unread,
Mar 13, 2021, 12:22:29 PM3/13/21
to redbe...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "redbeanphp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redbeanorm+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redbeanorm/d9b8d4ab-4296-478f-ae04-03c27e2c3ed5n%40googlegroups.com.

Benoit Pruneau

unread,
Mar 14, 2021, 11:27:40 AM3/14/21
to redbeanphp
Thank you Ben!
Reply all
Reply to author
Forward
0 new messages