ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:structure:sample_usage

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:structure:sample_usage [2016/04/09 21:42] mnewnhamv5:dictionary:structure:sample_usage [2016/04/09 21:46] (current) mnewnham
Line 10: Line 10:
 $t->addAttribute('ENGINE INNODB','mysql'); $t->addAttribute('ENGINE INNODB','mysql');
 $t->addColumnObject('COL1','I'); $t->addColumnObject('COL1','I');
-$t->addColumnObject('COL1','I')->addAttribute('NOTNULL');+$t->addColumnObject('COL1','I') 
 +                   ->addAttribute('NOTNULL');
  
 $c = $t->addColumnObject('COL2','C(64)'); $c = $t->addColumnObject('COL2','C(64)');
Line 18: Line 19:
 $ii = $i->addIndexItemObject('COL1'); $ii = $i->addIndexItemObject('COL1');
  
-$t->addColumnObject('COL1','C(32)')->addAttribute('NOTNULL'+$t->addColumnObject('COL1','C(32)') 
-                                   ->addAttribute(array('DEFAULT'=>'abc'));+                ->addAttribute('NOTNULL'
 +                ->addAttribute(array('DEFAULT'=>'abc'));
  
-$t->addColumnObject('COL2','I')->addAttribute('NOTNULL'+$t->addColumnObject('COL2','I') 
-                               ->addAttribute('PRIMARY'+               ->addAttribute('NOTNULL'
-                               ->addAttribute('AUTO');+               ->addAttribute('PRIMARY'
 +               ->addAttribute('AUTO');
 $t->addColumnObject('COL3','N(12.2)'); $t->addColumnObject('COL3','N(12.2)');
-$t->addColumnObject('COL4','C(64)')->addAttribute(array('CHARACTER SET'=>'"ascii"'))->addAttribute(array('COLLATE'=>'"latin1_swedish_ci"'),'mysql');+$t->addColumnObject('COL4','C(64)') 
 +              ->addAttribute(array('CHARACTER SET'=>'"ascii"')) 
 +              ->addAttribute(array('COLLATE'=>'"latin1_swedish_ci"'),'mysql');
  
 $t->addColumnObject('COL5',"ENUM('cats','dogs','fish')"); $t->addColumnObject('COL5',"ENUM('cats','dogs','fish')");
-$t->addColumnObject('COL6','T')->addAttribute('DEFTIMESTAMP');+$t->addColumnObject('COL6','T') 
 +              ->addAttribute('DEFTIMESTAMP');
  
-$t->addColumnObject('COL7','D')->addAttribute('DEFDATE');+$t->addColumnObject('COL7','D') 
 +              ->addAttribute('DEFDATE');
  
-$t->addIndexObject('COL4-INDEX')->addIndexItem('COL4')->addAttribute('ASC'); +$t->addIndexObject('COL4-INDEX') 
-$t->addIndexObject('COL4-INDEX')->addIndexItem('COL5');+              ->addIndexItem('COL4') 
 +              ->addAttribute('ASC'); 
 +$t->addIndexObject('COL4-INDEX') 
 +              ->addIndexItem('COL5');
  
 $sql = $dict->createTableSql($tabledef); $sql = $dict->createTableSql($tabledef);
v5/dictionary/structure/sample_usage.1460230955.txt.gz · Last modified: 2017/04/21 11:29 (external edit)