Help And Documentation

2: Object Reference

2.8: The Query Condition Object

A Query Condition object can be used to group together a list of conditions that are separated by the same logical operator ('AND' or 'OR').

This is useful if the logic that your database query requires looks like the following:

SELECT userid FROM users WHERE (type = 'normal' AND active = 1) OR (type = 'admin' AND receives_notifications = 1)

This database query would require at least two Query Condition objects to represent the two groups of conditions that you can see inside of the brackets.


Comparison Type

This method can only be used once.

Choose how conditions are compared to each other. If you select 'And' then all of the conditions must be met for the database query to return or affect a database row. If you select 'Or' then any of the conditions must be met for the database query to return or affect a database row.

Parameters

Name Text Variable Object Array
Comparison Yes No No No

Add Condition

This method can be used multiple times.

This method allows you to add a condition which is used to filter out rows from your database query so that you can select or affect only the rows that you want to. These conditions are compared against each other using the 'And' comparison type by default if a comparison type has not been set for this object.

Parameters

Name Text Variable Object Array
Field Yes No No No
Operator Yes No No No
Value Yes Yes Yes No

Next Page » « Previous Page