You are here

function _db_create_key_sql in Drupal 6

Same name in this branch
  1. 6 includes/database.mysql-common.inc \_db_create_key_sql()
  2. 6 includes/database.pgsql.inc \_db_create_key_sql()

Related topics

5 calls to _db_create_key_sql()
db_add_index in includes/database.mysql-common.inc
Add an index.
db_add_primary_key in includes/database.mysql-common.inc
Add a primary key.
db_add_unique_key in includes/database.mysql-common.inc
Add a unique key.
_db_create_index_sql in includes/database.pgsql.inc
_db_create_keys_sql in includes/database.mysql-common.inc

File

includes/database.mysql-common.inc, line 116
Functions shared between mysql and mysqli database engines.

Code

function _db_create_key_sql($fields) {
  $ret = array();
  foreach ($fields as $field) {
    if (is_array($field)) {
      $ret[] = $field[0] . '(' . $field[1] . ')';
    }
    else {
      $ret[] = $field;
    }
  }
  return implode(', ', $ret);
}