32 lines
749 B
PHP
32 lines
749 B
PHP
<?php
|
|
|
|
|
|
class Historical extends CI_Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->mongodb = new MongoDB\Client(
|
|
'mongodb://localhost/',
|
|
[
|
|
"username" => "one",
|
|
"password" => "sasone102938",
|
|
"authSource" => "admin"
|
|
]
|
|
);
|
|
}
|
|
public function index()
|
|
{
|
|
$dbs = $this->mongodb->listDatabases();
|
|
print_r($dbs);
|
|
// $pasien = array(
|
|
// "name" => "Kris",
|
|
// "address" => [
|
|
// "Jl Muararajeun Tengah no 22",
|
|
// "Jl Antapani Asri no 30"
|
|
// ]
|
|
// );
|
|
// $this->mongo_db("pasien", $pasien);
|
|
}
|
|
}
|