ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:createtablesql

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
v5:dictionary:createtablesql [2016/01/13 02:06] – ↷ Links adapted because of a move operation mnewnhamv5:dictionary:createtablesql [2016/03/05 01:54] – [$tableOptions] mnewnham
Line 28: Line 28:
 A string holding information regarding the columns to create in the new table. For a detailed description of the format of this string, see [[v5:dictionary:addcolumnsql|addColumnSql()]]. A string holding information regarding the columns to create in the new table. For a detailed description of the format of this string, see [[v5:dictionary:addcolumnsql|addColumnSql()]].
 ==== $tableOptions ==== ==== $tableOptions ====
-An optional array of information that adds information regarding the table creation. This array may also contain field specific information, for example information pertaining to auto-increment fields.+An optional array of information that adds information regarding the table creation. This array may also contain field specific information, for example information pertaining to auto-increment fields. Another feature of this option is that it can be used to provide database specific options to the table itself, e.g.
  
 +<code php>
 +
 +$tabname = 'TEST';
 +$flds    = 'column definitions....';
 +$opts    = array('MYSQL'=>"ENGINE INNODB,COMPRESSION 'ZLIB'",
 +                 'DB2'=>'TABLESPACE LARGE_SPACE');
 +
 +$sql = $db->createTableSql($tabname,$flds,$opts);
 +</code>
 +
 +In the example above, the values provided in ''$opts'' will be added to the table if the **data provider* matches that of the currently attached database.
 ===== Usage ===== ===== Usage =====
 <code php> <code php>
v5/dictionary/createtablesql.txt · Last modified: 2016/03/05 01:55 by mnewnham