Friday, July 30, 2010

PHP CLASSES AND IF/ELSE BLOCK

//*********************************working
$flag='3';

if($flag=='3')
{
class cc {
function __construct() {
echo 'cc!';

}
}

}

$type = 'cc';
$obj = new $type;
//****************************************not working

$type = 'cc';
$obj = new $type;
$flag='3';

if($flag=='3')
{
class cc {
function __construct() {
echo 'cc!';

}
}

}


?>

Tuesday, July 27, 2010

postgresql-ARRAY

 
expression operator ANY (array expression)
expression operator SOME (array expression)
 
 The right-hand side is a parenthesized expression, which must yield an
array value.
The left-hand expression
is evaluated and compared to each element of the array using the
given operator, which must yield a Boolean
result.
The result of ANY is “true” if any true result is obtained.
The result is “false” if no true result is found (including the special
case where the array has zero elements).If the array expression yields a null array, the result of
ANY will be null.  If the left-hand expression yields null,
the result of ANY is ordinarily null (though a non-strict
comparison operator could possibly yield a different result).
Also, if the right-hand array contains any null elements and no true
comparison result is obtained, the result of ANY
will be null, not false (again, assuming a strict comparison operator).
This is in accordance with SQL's normal rules for Boolean combinations
of null values.
 
SOME is a synonym for ANY.

 

Saturday, July 24, 2010