You are here

function apdqc_create_key_sql in Asynchronous Prefetch Database Query Cache 7

Given a list of database fields; outputs a string for use in db queries.

Parameters

array $fields: An array of database columns.

Return value

string String for use in db queries.

1 call to apdqc_create_key_sql()
apdqc_convert_cache_index in ./apdqc.admin.inc
Converts a database index from one form to another.

File

./apdqc.mysql.inc, line 1012
APDQC Database interface code for MySQL database servers.

Code

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