Add missing Steven API runtime files
This commit is contained in:
28
steven/conf/koneksiPDO.php
Normal file
28
steven/conf/koneksiPDO.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
class createCon
|
||||
{
|
||||
public $host = 'localhost';
|
||||
public $user = 'spota_informatika';
|
||||
public $pass = 'Eud!}ZML3HVO';
|
||||
public $db = 'spota_spotadb';
|
||||
|
||||
public $myconn;
|
||||
|
||||
public function connect()
|
||||
{
|
||||
$con = new PDO('mysql:host='.$this->host.';dbname='.$this->db, $this->user, $this->pass);
|
||||
if (!$con) {
|
||||
die('Could not connect to database!');
|
||||
} else {
|
||||
$this->myconn = $con;
|
||||
}
|
||||
|
||||
return $this->myconn;
|
||||
}
|
||||
|
||||
public function close()
|
||||
{
|
||||
$this->myconn = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user