ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:setactualtype

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v5:dictionary:setactualtype [2017/05/15 16:44] – [Description] typo dregadv5:dictionary:setactualtype [2017/07/22 18:39] (current) mnewnham
Line 22: Line 22:
 A connection to a data dictionary object is required, but a database connection is not. A connection to a data dictionary object is required, but a database connection is not.
 ===== Usage ==== ===== Usage ====
-In this example we want to change the behavior of the mssqlnative driver, so that instead of the default ''datetime'' type associated with the 'D' metatype, we want to use data dictionary functions to create a more portable 'date' type (available since SQL Server 2008).+In this example we want to change the behavior of the mssqlnative driver, so that instead of the default ''datetime'' type associated with the ''D'' metatype, we want to use data dictionary functions to create a more portable ''date'' type (available since SQL Server 2008).
 <code php> <code php>
 $db = newAdoConnection('mssqlnative'); $db = newAdoConnection('mssqlnative');
Line 29: Line 29:
 $dict->setActualType('D','DATE'); $dict->setActualType('D','DATE');
 </code> </code>
-In the second example, we will create a new actual types so that we can use the adodb dictionary function to create tables containing geospatial information.+In the second example, we will create a new **actual type** so that we can use the ADOdb dictionary function to create tables containing geospatial information.
  
 <code php> <code php>
-$db = newAdoConnection('mysql');+$db = newAdoConnection('mysqli');
 $dict = NewDataDictionary($db); $dict = NewDataDictionary($db);
  
Line 41: Line 41:
  * Add 2 new columns to table  * Add 2 new columns to table
 */ */
-$columns = 'GEODATA G, POINTDATA P'; +$columns = 'GEODATA_COL G, POINTDATA_COL P'; 
-$sqlarray = $dict->addColumnSql('POSITION',$columns);+$sqlarray = $dict->addColumnSql('POSITION_TABLE',$columns);
    
 print_r($sqlarray); print_r($sqlarray);
Line 50: Line 50:
 Array Array
 ( (
- [0] => ALTER TABLE POSITION ADD GEODATA GEOMETERY + [0] => ALTER TABLE POSITION_TABLE ADD GEODATA_COL GEOMETRY 
- [1] => ALTER TABLE POSITION ADD POINTDATA POINT+ [1] => ALTER TABLE POSITION_TABLE ADD POINTDATA_COL POINT
 ) )
 */ */
v5/dictionary/setactualtype.txt · Last modified: 2017/07/22 18:39 by mnewnham