--- documentation/manual/en/module_specs/Zend_Validate-Db.xml (revision 23822) +++ documentation/manual/en/module_specs/Zend_Validate-Db.xml (working copy) @@ -172,12 +172,12 @@ getId(); -$clause = $db->quoteInto('post_id = ?', $category_id); +$email = 'user@example.com'; +$clause = $db->quoteInto('email = ?', $email); $validator = new Zend_Validate_Db_RecordExists( array( - 'table' => 'posts_categories', - 'field' => 'post_id', + 'table' => 'users', + 'field' => 'username', 'exclude' => $clause ) ); @@ -194,9 +194,10 @@ ]]> - The above example will check the 'posts_categories' table - to ensure that a record with the 'post_id' has a value - matching $category_id + The above example will check the 'users' table + to ensure that only a record with both the username + $username and with the email + $email is valid.