Skip to content

Instantly share code, notes, and snippets.

@muskie9
Created February 3, 2017 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muskie9/c05d327046c986eb5cc6616d3933c440 to your computer and use it in GitHub Desktop.
Save muskie9/c05d327046c986eb5cc6616d3933c440 to your computer and use it in GitHub Desktop.
<?php
public function getLeaders() {
global $databaseConfig, $databaseConfig2;
DB::connect($databaseConfig2);// connect to DB 2
$query = DB::Query("SELECT * FROM leader");
$arrayList = ArrayList::create();
foreach ($query as $row){
$arrayList->push(ArrayData::create($row));
}
DB::connect($databaseConfig);// when done, switch back to the regular DB
return $arrayList;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment