Contributions API

Calling all Drupal developers!

Help us get this on the first page of Digg. DIGG NOW!

Modules in 6

drush_sql_query

Definition

drush_sql_query($query = NULL)
contributions/drush/drush_sql/drush_sql.module, line 158

Description

Command callback. Executes the given SQL query on the Drupal database. Reads from STDIN if no query is provided.

Code

<?php
function drush_sql_query($query = NULL) {
  // Get any arguments to be passed through to the SQL client program.
  if (func_num_args() > 1 && ($args = func_get_args())) {
    $args = ' ' . implode(' ', array_slice($args, 1)); // skip query argument
  }
  
  return drush_sql_query_execute($query, NULL, $args);
}
?>