fix
This commit is contained in:
@@ -30,6 +30,26 @@ class Database extends Config
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
public $db = [
|
||||||
|
'DSN' => '',
|
||||||
|
'hostname' => '10.10.33.21',
|
||||||
|
'username' => 'savvy',
|
||||||
|
'password' => 'savvy001!',
|
||||||
|
'database' => 'savvy',
|
||||||
|
'DBDriver' => 'postgre',
|
||||||
|
'DBPrefix' => '',
|
||||||
|
'pConnect' => false,
|
||||||
|
'DBDebug' => (ENVIRONMENT !== 'production'),
|
||||||
|
'charset' => 'utf8',
|
||||||
|
'DBCollat' => 'utf8_general_ci',
|
||||||
|
'swapPre' => '',
|
||||||
|
'encrypt' => false,
|
||||||
|
'compress' => false,
|
||||||
|
'strictOn' => false,
|
||||||
|
'failover' => [],
|
||||||
|
'port' => 5432,
|
||||||
|
];
|
||||||
|
|
||||||
public $default = [
|
public $default = [
|
||||||
'DSN' => '',
|
'DSN' => '',
|
||||||
'hostname' => 'localhost',
|
'hostname' => 'localhost',
|
||||||
|
|||||||
+18
-18
@@ -6,25 +6,25 @@ class Home extends BaseController
|
|||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$endpoints = array(
|
$db = \Config\Database::connect('db');
|
||||||
'getdrycleanservicelist' => array('POST'),
|
|
||||||
'createuser' => array('POST'),
|
|
||||||
'userlogin' => array('POST'),
|
|
||||||
'updateprofile' => array('POST'),
|
|
||||||
'updsprofile' => array('POST'),
|
|
||||||
'newlundrypickup' => array('POST'),
|
|
||||||
'newdrycleanpickup' => array('POST'),
|
|
||||||
'confirmlundrypickup' => array('POST'),
|
|
||||||
'savecardpayment' => array('POST'),
|
|
||||||
'getlundrylocation' => array('POST'),
|
|
||||||
'getcardpaymentlist' => array('POST'),
|
|
||||||
'getmyservicelist' => array('POST'),
|
|
||||||
'getoneserviceitem' => array('POST'),
|
|
||||||
'loadprofile' => array('POST'),
|
|
||||||
'deletecard' => array('POST')
|
|
||||||
);
|
|
||||||
|
|
||||||
$data['endpoints'] = $endpoints;
|
$query = $db->query('SELECT id, bank_name FROM banks');
|
||||||
|
$results = $query->getResult();
|
||||||
|
|
||||||
|
foreach ($results as $row) {
|
||||||
|
echo $row->id;
|
||||||
|
echo $row->bank_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo 'Total Results: ' . count($results);
|
||||||
|
|
||||||
|
|
||||||
|
$query = $this->db->get('banks');
|
||||||
|
$results = array();
|
||||||
|
foreach ($query->result() as $result) {
|
||||||
|
$results[] = $result;
|
||||||
|
}
|
||||||
|
var_dump( $results );
|
||||||
return view('welcome_message',$data);
|
return view('welcome_message',$data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user