ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:axmls:setprefix

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
axmls:setprefix [2015/11/15 23:57] mnewnhamv5:axmls:setprefix [2016/01/13 02:26] (current) – ↷ Page moved from axmls:setprefix to v5:axmls:setprefix mnewnham
Line 5: Line 5:
  
   boolean setPrefix (   boolean setPrefix (
-    optional string $prefix = '' +    string $prefix = '' 
-    optional boolean=TRUE+    optional bool $addUnderscore=true
     )     )
 </WRAP> </WRAP>
 +===== Description =====
 +Sets a prefix for database objects
 +
 +Call this method to set a standard prefix that will be prepended to **all database tables and indexes**. 
 +
 +If the optional ''$addUnderscore'' parameter is set, an underscore is automatically appended to the prefix.
 +
 +===== Usage =====
 +<code php>
 +/*
 +* Assuming xml schema contains tables a,b,c
 +*/
 +$axmls->setPrefix('test');
 +
 +/*
 +* tables will be created as 'test_a','test_b','test_c'
 +*/
 +
 +$axmls->setPrefix('test',false);
 +
 +/*
 +* tables will be created as 'testa','testb','testc'
 +*/
 +</code>
 +
 +===== Note =====
 +Some database restrict the length of table and index names. Ensure that the total length of prefix + table name does not exceed that limit.
  
v5/axmls/setprefix.1447628237.txt.gz · Last modified: 2017/04/21 11:22 (external edit)