Skip to content

Instantly share code, notes, and snippets.

@madeingnecca
Last active March 20, 2019 20:46
Show Gist options
  • Save madeingnecca/7646ba50f9f4540fb64ddbe9b2240d53 to your computer and use it in GitHub Desktop.
Save madeingnecca/7646ba50f9f4540fb64ddbe9b2240d53 to your computer and use it in GitHub Desktop.
DRUPAL 7 - db query to show users data
<?php
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
$result = db_query('SELECT * FROM users');
foreach($result as $item) {
print $item->uid.' ';
print $item->name.' ';
print $item->mail.'<br />';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment