XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
DBMssql.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
12 class DBMssql extends DB
13 {
14 
19  var $prefix = 'xe';
20  var $param = array();
21  var $comment_syntax = '/* %s */';
22 
30  var $column_type = array(
31  'bignumber' => 'bigint',
32  'number' => 'int',
33  'varchar' => 'nvarchar',
34  'char' => 'nchar',
35  'text' => 'ntext',
36  'bigtext' => 'ntext',
37  'date' => 'nvarchar(14)',
38  'float' => 'float',
39  );
40 
45  function __construct($auto_connect = TRUE)
46  {
47  $this->_setDBInfo();
48  if($auto_connect) $this->_connect();
49  }
50 
55  function create()
56  {
57  return new DBMssql;
58  }
59 
67  {
68  //sqlsrv_configure( 'WarningsReturnAsErrors', 0 );
69  //sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL );
70  //sqlsrv_configure( 'LogSubsystems', SQLSRV_LOG_SYSTEM_ALL );
71  $result = @sqlsrv_connect($connection["db_hostname"], array('Database' => $connection["db_database"], 'UID' => $connection["db_userid"], 'PWD' => $connection["db_password"]));
72 
73  if(!$result)
74  {
75  $errors = print_r(sqlsrv_errors(), true);
76  $this->setError(-1, 'database connect fail' . PHP_EOL . $errors);
77  return;
78  }
79  return $result;
80  }
81 
88  function _close($connection)
89  {
90  $this->commit();
91  sqlsrv_close($connection);
92  }
93 
100  function addQuotes($string)
101  {
102  if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
103  {
104  $string = stripslashes(str_replace("\\", "\\\\", $string));
105  }
106  //if(!is_numeric($string)) $string = str_replace("'","''",$string);
107 
108  return $string;
109  }
110 
116  function _begin($transactionLevel = 0)
117  {
118  $connection = $this->_getConnection('master');
119 
120  if(!$transactionLevel)
121  {
122  if(sqlsrv_begin_transaction($connection) === false)
123  {
124  return;
125  }
126  }
127  else
128  {
129  $this->_query("SAVE TRANS SP" . $transactionLevel, $connection);
130  }
131  return true;
132  }
133 
139  function _rollback($transactionLevel = 0)
140  {
141  $connection = $this->_getConnection('master');
142 
143  $point = $transactionLevel - 1;
144 
145  if($point)
146  {
147  $this->_query("ROLLBACK TRANS SP" . $point, $connection);
148  }
149  else
150  {
151  sqlsrv_rollback($connection);
152  }
153  return true;
154  }
155 
161  function _commit()
162  {
163  $connection = $this->_getConnection('master');
164  sqlsrv_commit($connection);
165  return true;
166  }
167 
176  {
177  $_param = array();
178 
179  if(count($this->param))
180  {
181  foreach($this->param as $k => $o)
182  {
183  if($o->isColumnName())
184  {
185  continue;
186  }
187  if($o->getType() == 'number')
188  {
189  $value = $o->getUnescapedValue();
190  if(is_array($value))
191  {
192  $_param = array_merge($_param, $value);
193  }
194  else
195  {
196  $_param[] = $o->getUnescapedValue();
197  }
198  }
199  else
200  {
201  $value = $o->getUnescapedValue();
202  if(is_array($value))
203  {
204  foreach($value as $v)
205  {
206  $_param[] = array($v, SQLSRV_PARAM_IN, SQLSRV_PHPTYPE_STRING('utf-8'));
207  }
208  }
209  else
210  {
211  $_param[] = array($value, SQLSRV_PARAM_IN, SQLSRV_PHPTYPE_STRING('utf-8'));
212  }
213  }
214  }
215  }
216 
217  // Run the query statement
218  $result = false;
219  if(count($_param))
220  {
221  $args = $this->_getParametersByReference($_param);
222  $stmt = sqlsrv_prepare($connection, $query, $args);
223  }
224  else
225  {
226  $stmt = sqlsrv_prepare($connection, $query);
227  }
228 
229  if(!$stmt)
230  {
231  $result = false;
232  }
233  else
234  {
235  $result = sqlsrv_execute($stmt);
236  }
237 
238  // Error Check
239  if(!$result)
240  {
241  $this->setError(print_r(sqlsrv_errors(), true));
242  }
243 
244  $this->param = array();
245 
246  return $stmt;
247  }
248 
257  function _getParametersByReference($_param)
258  {
259  $copy = array();
260  $args = array();
261  $i = 0;
262  foreach($_param as $key => $value)
263  {
264  if(is_array($value))
265  {
266  $value_copy = $value;
267  $value_arg = array();
268  $value_arg[] = &$value_copy[0];
269  $value_arg[] = $value_copy[1];
270  $value_arg[] = $value_copy[2];
271  }
272  else
273  {
274  $value_arg = $value;
275  }
276  $copy[$key] = $value_arg;
277  $args[$i++] = &$copy[$key];
278  }
279  return $args;
280  }
281 
288  function _fetch($result, $arrayIndexEndValue = NULL)
289  {
290  $output = array();
291  if(!$this->isConnected() || $this->isError() || !$result)
292  {
293  return $output;
294  }
295 
296  $c = sqlsrv_num_fields($result);
297  $m = null;
298 
299  while(sqlsrv_fetch($result))
300  {
301  if(!$m)
302  {
303  $m = sqlsrv_field_metadata($result);
304  }
305  unset($row);
306  for($i = 0; $i < $c; $i++)
307  {
308  $row->{$m[$i]['Name']} = sqlsrv_get_field($result, $i, SQLSRV_PHPTYPE_STRING('utf-8'));
309  }
310  if($arrayIndexEndValue)
311  {
312  $output[$arrayIndexEndValue--] = $row;
313  }
314  else
315  {
316  $output[] = $row;
317  }
318  }
319 
320  if(count($output) == 1)
321  {
322  if(isset($arrayIndexEndValue))
323  {
324  return $output;
325  }
326  else
327  {
328  return $output[0];
329  }
330  }
331  return $output;
332  }
333 
339  function getNextSequence()
340  {
341  $query = sprintf("insert into %ssequence (seq) values (ident_incr('%ssequence'))", $this->prefix, $this->prefix);
342  $this->_query($query);
343 
344  $query = sprintf("select ident_current('%ssequence')+1 as sequence", $this->prefix);
345  $result = $this->_query($query);
346  $tmp = $this->_fetch($result);
347 
348 
349  return $tmp->sequence;
350  }
351 
357  function isTableExists($target_name)
358  {
359  $query = sprintf("select name from sysobjects where name = '%s%s' and xtype='U'", $this->prefix, $this->addQuotes($target_name));
360  $result = $this->_query($query);
361  $tmp = $this->_fetch($result);
362 
363  if(!$tmp)
364  {
365  return false;
366  }
367  return true;
368  }
369 
380  function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = null, $notnull = false)
381  {
382  if($this->isColumnExists($table_name, $column_name))
383  {
384  return;
385  }
386  $type = $this->column_type[$type];
387  if(strtoupper($type) == 'INTEGER')
388  {
389  $size = '';
390  }
391 
392  $query = sprintf("alter table %s%s add \"%s\" ", $this->prefix, $table_name, $column_name);
393  if($size)
394  {
395  $query .= sprintf(" %s(%s) ", $type, $size);
396  }
397  else
398  {
399  $query .= sprintf(" %s ", $type);
400  }
401 
402  if(isset($default))
403  {
404  $query .= sprintf(" default '%s' ", $default);
405  }
406  if($notnull)
407  {
408  $query .= " not null ";
409  }
410 
411  return $this->_query($query);
412  }
413 
420  function dropColumn($table_name, $column_name)
421  {
422  if(!$this->isColumnExists($table_name, $column_name))
423  {
424  return;
425  }
426  $query = sprintf("alter table %s%s drop column \"%s\" ", $this->prefix, $table_name, $column_name);
427  $this->_query($query);
428  }
429 
436  function isColumnExists($table_name, $column_name)
437  {
438  $query = sprintf("select syscolumns.name as name from syscolumns, sysobjects where sysobjects.name = '%s%s' and sysobjects.id = syscolumns.id and syscolumns.name = '%s'", $this->prefix, $table_name, $column_name);
439  $result = $this->_query($query);
440  if($this->isError())
441  {
442  return;
443  }
444  $tmp = $this->_fetch($result);
445  if(!$tmp->name)
446  {
447  return false;
448  }
449  return true;
450  }
451 
462  function addIndex($table_name, $index_name, $target_columns, $is_unique = false)
463  {
464  if($this->isIndexExists($table_name, $index_name))
465  {
466  return;
467  }
468  if(!is_array($target_columns))
469  {
470  $target_columns = array($target_columns);
471  }
472 
473  $query = sprintf("create %s index %s on %s%s (%s)", $is_unique ? 'unique' : '', $index_name, $this->prefix, $table_name, implode(',', $target_columns));
474  $this->_query($query);
475  }
476 
484  function dropIndex($table_name, $index_name, $is_unique = false)
485  {
486  if(!$this->isIndexExists($table_name, $index_name))
487  {
488  return;
489  }
490  $query = sprintf("drop index %s%s.%s", $this->prefix, $table_name, $index_name);
491  $this->_query($query);
492  }
493 
500  function isIndexExists($table_name, $index_name)
501  {
502  $query = sprintf("select sysindexes.name as name from sysindexes, sysobjects where sysobjects.name = '%s%s' and sysobjects.id = sysindexes.id and sysindexes.name = '%s'", $this->prefix, $table_name, $index_name);
503 
504  $result = $this->_query($query);
505  if($this->isError())
506  {
507  return;
508  }
509  $tmp = $this->_fetch($result);
510 
511  if(!$tmp->name)
512  {
513  return false;
514  }
515  return true;
516  }
517 
523  function createTableByXml($xml_doc)
524  {
525  return $this->_createTable($xml_doc);
526  }
527 
533  function createTableByXmlFile($file_name)
534  {
535  if(!file_exists($file_name))
536  {
537  return;
538  }
539  // read xml file
540  $buff = FileHandler::readFile($file_name);
541  return $this->_createTable($buff);
542  }
543 
553  function _createTable($xml_doc)
554  {
555  // xml parsing
556  $oXml = new XmlParser();
557  $xml_obj = $oXml->parse($xml_doc);
558  // Create a table schema
559  $table_name = $xml_obj->table->attrs->name;
560  if($this->isTableExists($table_name))
561  {
562  return;
563  }
564 
565  if($table_name == 'sequence')
566  {
567  $table_name = $this->prefix . $table_name;
568  $query = sprintf('create table %s ( sequence int identity(1,1), seq int )', $table_name);
569  return $this->_query($query);
570  }
571  else
572  {
573  $table_name = $this->prefix . $table_name;
574 
575  if(!is_array($xml_obj->table->column))
576  {
577  $columns[] = $xml_obj->table->column;
578  }
579  else
580  {
581  $columns = $xml_obj->table->column;
582  }
583 
584  $primary_list = array();
585  $unique_list = array();
586  $index_list = array();
587 
588  $typeList = array('number' => 1, 'text' => 1);
589  foreach($columns as $column)
590  {
591  $name = $column->attrs->name;
592  $type = $column->attrs->type;
593  $size = $column->attrs->size;
594  $notnull = $column->attrs->notnull;
595  $primary_key = $column->attrs->primary_key;
596  $index = $column->attrs->index;
597  $unique = $column->attrs->unique;
598  $default = $column->attrs->default;
599  $auto_increment = $column->attrs->auto_increment;
600 
601  $column_schema[] = sprintf('[%s] %s%s %s %s %s', $name, $this->column_type[$type], !isset($typeList[$type]) && $size ? '(' . $size . ')' : '', isset($default) ? "default '" . $default . "'" : '', $notnull ? 'not null' : 'null', $auto_increment ? 'identity(1,1)' : '');
602 
603  if($primary_key)
604  {
605  $primary_list[] = $name;
606  }
607  else if($unique)
608  {
609  $unique_list[$unique][] = $name;
610  }
611  else if($index)
612  {
613  $index_list[$index][] = $name;
614  }
615  }
616 
617  if(count($primary_list))
618  {
619  $column_schema[] = sprintf("primary key (%s)", '"' . implode($primary_list, '","') . '"');
620  }
621 
622  $schema = sprintf('create table [%s] (%s%s)', $this->addQuotes($table_name), "\n", implode($column_schema, ",\n"));
623  $output = $this->_query($schema);
624  if(!$output)
625  {
626  return false;
627  }
628 
629  if(count($unique_list))
630  {
631  foreach($unique_list as $key => $val)
632  {
633  $query = sprintf("create unique index %s on %s (%s);", $key, $table_name, '[' . implode('],[', $val) . ']');
634  $this->_query($query);
635  }
636  }
637 
638  if(count($index_list))
639  {
640  foreach($index_list as $key => $val)
641  {
642  $query = sprintf("create index %s on %s (%s);", $key, $table_name, '[' . implode('],[', $val) . ']');
643  $this->_query($query);
644  }
645  }
646  return true;
647  }
648  }
649 
656  function _executeInsertAct($queryObject)
657  {
658  $query = $this->getInsertSql($queryObject, false);
659  $this->param = $queryObject->getArguments();
660  return $this->_query($query);
661  }
662 
668  function _executeUpdateAct($queryObject)
669  {
670  $query = $this->getUpdateSql($queryObject, false);
671  $this->param = $queryObject->getArguments();
672  return $this->_query($query);
673  }
674 
682  function getUpdateSql($query, $with_values = true, $with_priority = false)
683  {
684  $columnsList = $query->getUpdateString($with_values);
685  if($columnsList == '')
686  {
687  return new BaseObject(-1, "Invalid query");
688  }
689 
690  $from = $query->getFromString($with_values);
691  if($from == '')
692  {
693  return new BaseObject(-1, "Invalid query");
694  }
695 
696  $tables = $query->getTables();
697  $alias_list = '';
698  foreach($tables as $table)
699  {
700  $alias_list .= $table->getAlias();
701  }
702  implode(',', explode(' ', $alias_list));
703 
704  $where = $query->getWhereString($with_values);
705  if($where != '')
706  {
707  $where = ' WHERE ' . $where;
708  }
709 
710  $priority = $with_priority ? $query->getPriority() : '';
711 
712  return "UPDATE $priority $alias_list SET $columnsList FROM " . $from . $where;
713  }
714 
720  function _executeDeleteAct($queryObject)
721  {
722  $query = $this->getDeleteSql($queryObject, false);
723  $this->param = $queryObject->getArguments();
724  return $this->_query($query);
725  }
726 
733  function getSelectSql($query, $with_values = TRUE, $connection=NULL)
734  {
735  $with_values = false;
736 
737  //$limitOffset = $query->getLimit()->getOffset();
738  //if($limitOffset)
739  // TODO Implement Limit with offset with subquery
740  $limit = '';
741  $limitCount = '';
742  $limitQueryPart = $query->getLimit();
743  if($limitQueryPart)
744  {
745  $limitCount = $limitQueryPart->getLimit();
746  }
747  if($limitCount != '')
748  {
749  $limit = 'SELECT TOP ' . $limitCount;
750  }
751 
752  $select = $query->getSelectString($with_values);
753  if($select == '')
754  {
755  return new BaseObject(-1, "Invalid query");
756  }
757  if($limit != '')
758  {
759  $select = $limit . ' ' . $select;
760  }
761  else
762  {
763  $select = 'SELECT ' . $select;
764  }
765 
766  $from = $query->getFromString($with_values);
767  if($from == '')
768  {
769  return new BaseObject(-1, "Invalid query");
770  }
771  $from = ' FROM ' . $from;
772 
773  $where = $query->getWhereString($with_values);
774  if($where != '')
775  {
776  $where = ' WHERE ' . $where;
777  }
778 
779  $groupBy = $query->getGroupByString();
780  if($groupBy != '')
781  {
782  $groupBy = ' GROUP BY ' . $groupBy;
783  }
784 
785  $orderBy = $query->getOrderByString();
786  if($orderBy != '')
787  {
788  $orderBy = ' ORDER BY ' . $orderBy;
789  }
790 
791  if($limitCount != '' && $query->limit->start > 0)
792  {
793  $order = $query->getOrder();
794  $first_columns = array();
795  foreach($order as $val)
796  {
797  $tmpColumnName = $val->getPureColumnName();
798  $first_columns[] = sprintf('%s(%s) as %s', $val->getPureSortOrder()=='asc'?'max':'min', $tmpColumnName, $tmpColumnName);
799  $first_sub_columns[] = $tmpColumnName;
800  }
801 
802  $first_query = sprintf("select %s from (select top %d %s %s %s %s %s) xet", implode(',',$first_columns), $query->limit->start, implode(',',$first_sub_columns), $from, $where, $groupBy, $orderBy);
803  $this->param = $query->getArguments();
804  $result = $this->__query($first_query, $connection);
805  $tmp = $this->_fetch($result);
806 
807  $sub_cond = array();
808  foreach($order as $k => $v)
809  {
810  //for example... use Document
811  if(get_class($v->sort_order) == 'SortArgument')
812  {
813  $sort_order = $v->sort_order->value;
814  }
815  //for example... use comment, file
816  else
817  {
818  $sort_order = $v->sort_order;
819  }
820 
821  $sub_cond[] = sprintf("%s %s '%s'", $v->getPureColumnName(), $sort_order=='asc'?'>':'<', $tmp->{$v->getPureColumnName()});
822  }
823 
824  if(!$where)
825  {
826  $sub_condition = ' WHERE ( '.implode(' and ',$sub_cond).' )';
827  }
828  else
829  {
830  $sub_condition = ' and ( '.implode(' and ',$sub_cond).' )';
831  }
832  }
833  return $select . ' ' . $from . ' ' . $where .$sub_condition. ' ' . $groupBy . ' ' . $orderBy;
834  }
835 
844  function _executeSelectAct($queryObject, $connection = null)
845  {
846  $query = $this->getSelectSql($queryObject, true, $connection);
847 
848  if(strpos($query, "substr"))
849  {
850  $query = str_replace("substr", "substring", $query);
851  }
852 
853  // TODO Decide if we continue to pass parameters like this
854  $this->param = $queryObject->getArguments();
855 
856  $query .= (__DEBUG_QUERY__ & 1 && $output->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
857  $result = $this->_query($query, $connection);
858 
859  if($this->isError())
860  {
861  return $this->queryError($queryObject);
862  }
863  else
864  {
865  return $this->queryPageLimit($queryObject, $result, $connection);
866  }
867  }
868 
874  function getParser($force = FALSE)
875  {
876  return new DBParser("[", "]", $this->prefix);
877  }
878 
884  function queryError($queryObject)
885  {
886  $limit = $queryObject->getLimit();
887  if($limit && $limit->isPageHandler())
888  {
889  $buff = new BaseObject();
890  $buff->total_count = 0;
891  $buff->total_page = 0;
892  $buff->page = 1;
893  $buff->data = array();
894  $buff->page_navigation = new PageHandler(/* $total_count */0, /* $total_page */1, /* $page */1, /* $page_count */10); //default page handler values
895  return $buff;
896  }
897  else
898  {
899  return;
900  }
901  }
902 
910  function queryPageLimit($queryObject, $result, $connection)
911  {
912  $limit = $queryObject->getLimit();
913  if($limit && $limit->isPageHandler())
914  {
915  // Total count
916  $temp_where = $queryObject->getWhereString(true, false);
917  $count_query = sprintf('select count(*) as "count" %s %s', 'FROM ' . $queryObject->getFromString(), ($temp_where === '' ? '' : ' WHERE ' . $temp_where));
918 
919  // Check for distinct query and if found update count query structure
920  $temp_select = $queryObject->getSelectString(true);
921  $uses_distinct = stripos($temp_select, "distinct") !== false;
922  $uses_groupby = $queryObject->getGroupByString() != '';
923  if($uses_distinct || $uses_groupby)
924  {
925  $count_query = sprintf('select %s %s %s %s'
926  , $temp_select
927  , 'FROM ' . $queryObject->getFromString(true)
928  , ($temp_where === '' ? '' : ' WHERE ' . $temp_where)
929  , ($uses_groupby ? ' GROUP BY ' . $queryObject->getGroupByString() : '')
930  );
931 
932  // If query uses grouping or distinct, count from original select
933  $count_query = sprintf('select count(*) as "count" from (%s) xet', $count_query);
934  }
935 
936  $count_query .= (__DEBUG_QUERY__ & 1 && $queryObject->queryID) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
937  $this->param = $queryObject->getArguments();
938  $result_count = $this->_query($count_query, $connection);
939  $count_output = $this->_fetch($result_count);
940  $total_count = (int) $count_output->count;
941 
942  $list_count = $limit->list_count->getValue();
943  if(!$list_count)
944  {
945  $list_count = 20;
946  }
947  $page_count = $limit->page_count->getValue();
948  if(!$page_count)
949  {
950  $page_count = 10;
951  }
952  $page = $limit->page->getValue();
953  if(!$page || $page < 1)
954  {
955  $page = 1;
956  }
957  // Total pages
958  if($total_count)
959  {
960  $total_page = (int) (($total_count - 1) / $list_count) + 1;
961  }
962  else
963  {
964  $total_page = 1;
965  }
966 
967  // check the page variables
968  if($page > $total_page)
969  {
970  // If requested page is bigger than total number of pages, return empty list
971 
972  $buff = new BaseObject();
973  $buff->total_count = $total_count;
974  $buff->total_page = $total_page;
975  $buff->page = $page;
976  $buff->data = array();
977  $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count);
978  return $buff;
979 
980  if($queryObject->usesClickCount())
981  {
982  $update_query = $this->getClickCountQuery($queryObject);
983  $this->_executeUpdateAct($update_query);
984  }
985  }
986 
987  $start_count = ($page - 1) * $list_count;
988  $this->param = $queryObject->getArguments();
989  $virtual_no = $total_count - $start_count;
990  $data = $this->_fetch($result, $virtual_no);
991 
992  $buff = new BaseObject();
993  $buff->total_count = $total_count;
994  $buff->total_page = $total_page;
995  $buff->page = $page;
996  $buff->data = $data;
997  $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count);
998  }
999  else
1000  {
1001  $data = $this->_fetch($result);
1002  $buff = new BaseObject();
1003  $buff->data = $data;
1004  }
1005  return $buff;
1006  }
1007 
1008 }
1009 
1010 DBMssql::$isSupported = extension_loaded("sqlsrv");
1011 
1012 /* End of file DBMssql.class.php */
1013 /* Location: ./classes/db/DBMssql.class.php */
setError($errno=0, $errstr= 'success')
Definition: DB.class.php:476
__query($query, $connection)
_executeUpdateAct($queryObject)
isTableExists($target_name)
createTableByXmlFile($file_name)
static $isSupported
Definition: DB.class.php:19
addQuotes($string)
_executeSelectAct($queryObject, $connection=null)
$output
Definition: ko.install.php:193
_close($connection)
isConnected($type= 'master', $indx=0)
Definition: DB.class.php:360
addColumn($table_name, $column_name, $type= 'number', $size= '', $default=null, $notnull=false)
__connect($connection)
addIndex($table_name, $index_name, $target_columns, $is_unique=false)
$query
Definition: DB.class.php:84
Definition: DB.class.php:16
queryPageLimit($queryObject, $result, $connection)
__construct($auto_connect=TRUE)
_executeDeleteAct($queryObject)
_executeInsertAct($queryObject)
_rollback($transactionLevel=0)
$args
Definition: ko.install.php:185
isError()
Definition: DB.class.php:486
getParser($force=FALSE)
queryError($queryObject)
isIndexExists($table_name, $index_name)
_createTable($xml_doc)
createTableByXml($xml_doc)
_begin($transactionLevel=0)
getSelectSql($query, $with_values=TRUE, $connection=NULL)
dropIndex($table_name, $index_name, $is_unique=false)
readFile($filename)
_connect($type= 'master', $indx=0)
Definition: DB.class.php:1266
_getConnection($type= 'master', $indx=NULL)
Definition: DB.class.php:1001
_query($query, $connection=NULL)
Definition: DB.class.php:1193
getUpdateSql($query, $with_values=true, $with_priority=false)
_fetch($result, $arrayIndexEndValue=NULL)
$result
Definition: DB.class.php:66
_getParametersByReference($_param)
dropColumn($table_name, $column_name)
isColumnExists($table_name, $column_name)
_setDBInfo()
Definition: DB.class.php:1216
commit($force=FALSE)
Definition: DB.class.php:1157
$connection
Definition: DB.class.php:85