"A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: /home/iglesiab/application/third_party/MX/Loader.php
Line Number: 96"
dejo claro que instale el plugin HMVC....
aca esta el directorio http://prntscr.com/2rzwb
y los archivos son estos
Controller
Código PHP:
Ver original
class Login extends CI_Controller { function __construct() { parent::__construct(); } public function index() { $this->load->view('/view_login/index'); } public function prueba() { $this->load->model('Login_model'); $data['result'] = $this->Login_model->getData(); $data['page_title'] = "CI Hello World App!"; $this->load->view('welcome_message',$data); } }
Model
Código PHP:
Ver original
<?php /** * */ class Login_model extends CI_Model { function __construct() { parent::__construct(); $this->load->database(); } function getData() { //Query the data table for every record and row return $this->db->query("SELECT * FROM tb_persona"); } }
espero su ayuda :(