Author: dr Date: Fri Oct 19 11:10:46 2007 New Revision: 6528 Log: - Fixed issue #11609: Subselect query documentation is incorrect.
Modified: trunk/Database/ChangeLog trunk/Database/docs/tutorial_example_09.php trunk/Database/src/sqlabstraction/query_subselect.php Modified: trunk/Database/ChangeLog ============================================================================== --- trunk/Database/ChangeLog [iso-8859-1] (original) +++ trunk/Database/ChangeLog [iso-8859-1] Fri Oct 19 11:10:46 2007 @@ -1,6 +1,7 @@ 1.3.1 - [RELEASEDATE] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- Fixed issue #11609: Subselect query documentation is incorrect. - Fixed issue #11687: Mssql DSN with port does not work. - Fixed issue #11700: Subselects only work when there is a database instance set. Modified: trunk/Database/docs/tutorial_example_09.php ============================================================================== --- trunk/Database/docs/tutorial_example_09.php [iso-8859-1] (original) +++ trunk/Database/docs/tutorial_example_09.php [iso-8859-1] Fri Oct 19 11:10:46 2007 @@ -21,8 +21,8 @@ // WHERE company = :ezcValue1 AND id > 2 // ) ) $q->select('*') - ->from( 'query_test' ) - ->where( ' id >= 1 ', $q->expr->in( 'company', $q2->getQuery() ) ); + ->from( 'query_test' ) + ->where( ' id >= 1 ', $q->expr->in( 'company', $q2 ) ) ); $stmt = $q->prepare(); $stmt->execute(); Modified: trunk/Database/src/sqlabstraction/query_subselect.php ============================================================================== --- trunk/Database/src/sqlabstraction/query_subselect.php [iso-8859-1] (original) +++ trunk/Database/src/sqlabstraction/query_subselect.php [iso-8859-1] Fri Oct 19 11:10:46 2007 @@ -27,7 +27,7 @@ * // SELECT * FROM Greetings WHERE age > 10 AND user IN ( ( SELECT lastname FROM users ) ) * $q->select( '*' )->from( 'Greetings' ); * ->where( $q->expr->gt( 'age', 10 ), - * $q->expr->in( 'user', $q2->getQuery() ) ); + * $q->expr->in( 'user', $q2 ) ); * * $stmt = $q->prepare(); // $stmt is a normal PDOStatement * $stmt->execute(); @@ -81,7 +81,7 @@ * * $q->select('*') * ->from( 'table' ) - * ->where ( $q->expr->eq( 'id', $subSelect->getQuery() ) ); + * ->where ( $q->expr->eq( 'id', $subSelect ) ); * * $stmt = $q->prepare(); // the parameter $value is bound to the query. * $value = 4; @@ -121,7 +121,7 @@ * * $q->select('*') * ->from( 'table1' ) - * ->where ( $q->expr->eq( 'name', $subSelect->getQuery() ) ); + * ->where ( $q->expr->eq( 'name', $subSelect ) ); * * $stmt = $q->prepare(); // the $value is bound to the query. * $value = 4; @@ -143,8 +143,9 @@ /** * Return SQL string for subselect. * - * Typecasting shouild be done to make __toString() to be called. - * This will work in PHP 5.2, 6.0 + * Typecasting to (string) should be used to make __toString() to be called + * with PHP 5.1. This will not be needed in PHP 5.2 and higher when this + * object is used in a string context. * * Example: * <code> @@ -173,7 +174,7 @@ * $subSelect->select( name )->from( 'table2' ); * $q->select('*') * ->from( 'table1' ) - * ->where ( $q->expr->eq( 'name', $subSelect->getQuery() ) ); + * ->where ( $q->expr->eq( 'name', $subSelect ) ); * $stmt = $q->prepare(); * $stmt->execute(); * </code> @@ -201,7 +202,7 @@ * * $q->select(*) * ->from( 'table1' ) - * ->where ( $q->expr->eq( 'name', $subSelect->getQuery() ) ); + * ->where ( $q->expr->eq( 'name', $subSelect ) ); * * $stmt = $q->prepare(); // the $value is bound to the query. * $value = 4; -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components