Files
BE_IBL/application/controllers/mgdb/Historical.php
2026-04-15 15:23:57 +07:00

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);
}
}