Commit d8131096 authored by Dries's avatar Dries
Browse files

- Patch #373775 by sog_hadgraft: adjusted queries to confirm coding standards.

parent dacf4804
......@@ -31,7 +31,7 @@ function aggregator_view() {
}
$output .= theme('table', $header, $rows);
$result = db_query('SELECT c.cid, c.title, count(ci.iid) as items FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid GROUP BY c.cid, c.title ORDER BY title');
$result = db_query('SELECT c.cid, c.title, COUNT(ci.iid) as items FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid GROUP BY c.cid, c.title ORDER BY title');
$output .= '<h3>' . t('Category overview') . '</h3>';
......
......@@ -604,7 +604,7 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
$num_updated = db_update('test')->fields(array('job' => 'Musician'))->condition('job', 'Singer')->execute();
$this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
$num_matches = db_query("SELECT count(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$num_matches = db_query("SELECT COUNT(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
}
......@@ -615,7 +615,7 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
$num_updated = db_update('test')->fields(array('job' => 'Musician'))->condition('age', 26, '>')->execute();
$this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
$num_matches = db_query("SELECT count(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$num_matches = db_query("SELECT COUNT(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
}
......@@ -638,7 +638,7 @@ class DatabaseUpdateTestCase extends DatabaseTestCase {
$num_updated = $update->execute();
$this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
$num_matches = db_query("SELECT count(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$num_matches = db_query("SELECT COUNT(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$this->assertIdentical($num_matches, '1', t('Updated fields successfully.'));
}
}
......@@ -669,7 +669,7 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
$num_updated = $update->execute();
$this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
$num_matches = db_query("SELECT count(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$num_matches = db_query("SELECT COUNT(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
}
......@@ -682,7 +682,7 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->execute();
$this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
$num_matches = db_query("SELECT count(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$num_matches = db_query("SELECT COUNT(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
}
......@@ -695,7 +695,7 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->execute();
$this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
$num_matches = db_query("SELECT count(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$num_matches = db_query("SELECT COUNT(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$this->assertIdentical($num_matches, '1', t('Updated fields successfully.'));
}
......@@ -708,7 +708,7 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->execute();
$this->assertIdentical($num_updated, 2, t('Updated 2 records.'));
$num_matches = db_query("SELECT count(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$num_matches = db_query("SELECT COUNT(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$this->assertIdentical($num_matches, '2', t('Updated fields successfully.'));
}
......@@ -721,7 +721,7 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->execute();
$this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
$num_matches = db_query("SELECT count(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$num_matches = db_query("SELECT COUNT(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$this->assertIdentical($num_matches, '1', t('Updated fields successfully.'));
}
......@@ -738,7 +738,7 @@ class DatabaseUpdateComplexTestCase extends DatabaseTestCase {
->execute();
$this->assertIdentical($num_updated, 1, t('Updated 1 record.'));
$num_matches = db_query("SELECT count(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$num_matches = db_query("SELECT COUNT(*) FROM {test} WHERE job = :job", array(':job' => 'Musician'))->fetchField();
$this->assertIdentical($num_matches, '1', t('Updated fields successfully.'));
$person = db_query("SELECT * FROM {test} WHERE name = :name", array(':name' => 'Ringo'))->fetch();
......
......@@ -266,7 +266,7 @@ function taxonomy_overview_terms(&$form_state, $vocabulary) {
// We are not calling taxonomy_get_tree because that might fail with a big
// number of tags in the freetagging vocabulary.
$results = pager_query(db_rewrite_sql('SELECT t.*, h.parent FROM {taxonomy_term_data} t INNER JOIN {taxonomy_term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d ORDER BY weight, name', 't', 'tid'), $page_increment, 0, NULL, $vocabulary->vid);
$total_entries = db_query(db_rewrite_sql('SELECT count(*) FROM {taxonomy_term_data} t INNER JOIN {taxonomy_term_hierarchy} h ON t.tid = h.tid WHERE t.vid = :vid'), array(':vid' => $vocabulary->vid));
$total_entries = db_query(db_rewrite_sql('SELECT COUNT(*) FROM {taxonomy_term_data} t INNER JOIN {taxonomy_term_hierarchy} h ON t.tid = h.tid WHERE t.vid = :vid'), array(':vid' => $vocabulary->vid));
while ($term = db_fetch_object($results)) {
$key = 'tid:' . $term->tid . ':0';
$current_page[$key] = $term;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment