public function DatabaseConnection::makeComment

cis7 database.inc public DatabaseConnection::makeComment($comments)
cle7 database.inc public DatabaseConnection::makeComment($comments)
elmsmedia7 database.inc public DatabaseConnection::makeComment($comments)
icor7 database.inc public DatabaseConnection::makeComment($comments)
meedjum_blog7 database.inc public DatabaseConnection::makeComment($comments)
mooc7 database.inc public DatabaseConnection::makeComment($comments)

Flatten an array of query comments into a single comment string.

The comment string will be sanitized to avoid SQL injection attacks.

Parameters

$comments: An array of query comment strings.

Return value

A sanitized comment string.

File

includes/database/database.inc, line 583
Core systems for the database layer.

Class

DatabaseConnection
Base Database API class.

Code

public function makeComment($comments) {
  if (empty($comments)) {
    return '';
  }

  // Flatten the array of comments.
  $comment = implode('; ', $comments);

  // Sanitize the comment string so as to avoid SQL injection attacks.
  return '/* ' . $this->filterComment($comment) . ' */ ';
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.