MyBB Community Forums

Full Version: Don't query the database if a user has nothing in the row. How?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to not have an SQL query, if a user has nothing in a MySQL row?

Let's say I'm UID 1, and I have something in a specific table as a row with UID 1, so it performs an SQL query.

Let's say someone else is UID 2, and he doesn't have anything in the table, but it still performs an SQL query.

This is an unnecessary query, because it doesn't query anything for UID 2, because he doesn't have a row in the table.

Is this possible to accomplish?
If the field is in the user table then you could use $mybb->user variable?
It's in a table that I created manually, called 'mybb_mytable'.