tags:

views:

174

answers:

3

One of my webpages gets a recurring error: "No database selected", even though the DB is selected. Right about now it's a 50-50 chance whether the page will load just fine, or whether I receive this error. After one or two reloads, the page works again. I am including the exact same connection file on my other pages, and I don't have this problem. What could be the cause of this? I'm using ensim pro for webhosting. TIA.

A: 

It's probably that the database is not being connected to correctly, but that there is no error is generated when mysql_connect() or mysql_pconnect() are called.

Lots of potential causes of this problem, difficult to tell without more context.

artlung
+1  A: 

You are using mysql_selectdb() to specify the Database, as opposed to just connecting to the Database Server using mysql_(p)connect(), right?

Just asking as that was a mistake I made once.

Lucanos
A: 

You may need to check whether you have exceeded the disk quota or not. Sometimes this is the cause of the problem as you describled. I've seen this for many times.

garconcn