Welcome Guest, Not a member yet? Register   Sign In
Manage date as UTC
#3

(01-02-2016, 12:19 PM)skunkbad Wrote:
PHP Code:
$this->db->query('SET time_zone = "00:00"'); 


I've no chance to check it. I've some problem to retrieve database data.
Config/database.php seems ok with my db data information.

I've in controller Homepage.php:
PHP Code:
    public function index()
    {
        
$this->load->model('auth');
        
$data['results'] = $this->auth->example();
        
$this->load->view('homepage'$data);
    } 

Model Auth.php:
PHP Code:
function example()
    {
        
$query $this->db->query("SELECT * FROM tablename WHERE user_id = 1 LIMIT 1");
        if(
$query->num_rows == 0) { return false; }
        else { return 
$query->result(); }
    } 

View homepage.php:
PHP Code:
print_r($results); 

Database library load in config/autoload.php:
PHP Code:
$autoload['libraries'] = array('encrypt''session''database'); 

Page load give me blank page.. No errors, nothing. How can I check if database connection work fine?


About initial problem, I want try before by myself to find solution to implement the suggested command in all queries, but at all, now I can't try.

Thanks!
Reply


Messages In This Thread
Manage date as UTC - by Gianluigi - 01-02-2016, 11:40 AM
RE: Manage date as UTC - by skunkbad - 01-02-2016, 12:19 PM
RE: Manage date as UTC - by Gianluigi - 01-02-2016, 04:22 PM
RE: Manage date as UTC - by skunkbad - 01-02-2016, 05:19 PM
RE: Manage date as UTC - by Gianluigi - 01-03-2016, 04:19 AM
RE: Manage date as UTC - by skunkbad - 01-03-2016, 10:08 AM
RE: Manage date as UTC - by Gianluigi - 01-03-2016, 12:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB