< Portability: Right Trim   (Previous) Table of Contents (Next)   Portability: Error Mapping >

Portability: Null to Empty

require_once './examples/connect.inc';

$$dbms->query('CREATE TABLE WMDs (c CHAR(10) NULL)');
$$dbms->query("INSERT INTO WMDs VALUES ('')");
$c =& $$dbms->getOne('SELECT c FROM WMDs');

if (isset($c)) {
    echo 'Vote! And organize others to vote!';
} else {
    echo "W's scruples: " . gettype($c);
}

$$dbms->query('DROP TABLE WMDs');
Default Behavior
$dbms = 'oracle'; $dbms = 'pgsql';
W's scruples: NULL Vote! And organize others to vote!
$$dbms->setOption('portability', DB_PORTABILITY_NULL_TO_EMPTY);
$dbms = 'oracle'; $dbms = 'pgsql';
Vote! And organize others to vote! Vote! And organize others to vote!