i can`t connect to database if i use domain |
[eluser]minhbu[/eluser]
i have a hosting and domain.I uploaded a website to hosting. If i access by hosting link,it connect to database success, but when i use type domain name. exame http://subdomain.domain.com is website connect to database success but if i type http://subdomain.domain.com/news is i get a error Unable to connect to your database server using the provided settings. file database $db['default']['hostname'] = "localhost"; $db['default']['username'] = "username"; $db['default']['password'] = "password"; $db['default']['database'] = "mywebsite"; how do i type http://subdomain.domain.com/news is website connect to database success ???
[eluser]xeroblast[/eluser]
bcoz your host is incorrect... if you are using a DSN then you shoukld write it this way... Quote:dbdriver://username:password@hostname/database
[eluser]xeroblast[/eluser]
$this->load->database('dbdriver://username:password@hostname/database'); or check the http://ellislab.com/codeigniter/user-gui...cting.html |
Welcome Guest, Not a member yet? Register Sign In |