v5:reference:adodb_default_metatype
This is an old revision of the document!
ADODB_DEFAULT_METATYPE
The constant must be declared before including adodb.inc.php. It is not possible to change the default metatype during a procedure.
The constant ADODB_DEFAULT_METATYPE
controls the returned metatype of an unknown field type . The default behavior for metaType is 'N'.
This constant is useful for example in geometry data types where there is no defined metaType in ADOdb
Usage
/* * Connecting to DEFINE(ADODB_ASSOC_CASE,0); require "adodb/adodb.inc.php"; /* * connection assumed */ $SQL = "SELECT accountNo,accountName FROM table"; $data = $db->getAll($SQL); print_r($data); /* * Response is: [0]=>array('accountno'=>1, 'accountname'=>'The First Account' ), [1]=>array('accountno'=>2, 'accountname'=>'The Second Account' ) ) */
or:
DEFINE(ADODB_ASSOC_CASE,1); require "adodb/adodb.inc.php"; /* * connection assumed */ $SQL = "SELECT accountNo,accountName FROM table"; $data = $db->getAll($SQL); print_r($data); /* * Response is: [0]=>array('ACCOUNTNO'=>1, 'ACCOUNTNAME'=>'The First Account' ), [1]=>array('ACCOUNTNO'=>2, 'ACCOUNTNAME'=>'The Second Account' ) ) */
or:
DEFINE(ADODB_ASSOC_CASE,3); require "adodb/adodb.inc.php"; /* * connection assumed */ $SQL = "SELECT accountNo,accountName FROM table"; $data = $db->getAll($SQL); print_r($data); /* * Response is: [0]=>array('accountNo'=>1, 'accountName'=>'The First Account' ), [1]=>array('accountNo'=>2, 'accountName'=>'The Second Account' ) ) */
v5/reference/adodb_default_metatype.1454181311.txt.gz · Last modified: 2017/04/21 11:32 (external edit)