Welcome Guest, Not a member yet? Register   Sign In
i can`t connect to database if i use domain
#1

[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 ???
#2

[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
#3

[eluser]minhbu[/eluser]
where do i type above link ??
who have other way???
#4

[eluser]xeroblast[/eluser]
$this->load->database('dbdriver://username:password@hostname/database');

or check the http://ellislab.com/codeigniter/user-gui...cting.html




Theme © iAndrew 2016 - Forum software by © MyBB