Skip to main content
Inspiring
September 20, 2010
Answered

No database selected only happening on one page

  • September 20, 2010
  • 1 reply
  • 918 views

Hi,

I have a site that works with php and mysql database connection, other database elements work. Apart from on one page.

It just says: No database selected

This is happening on the server only. It works fine on localhost (XAMPP)

This topic has been closed for replies.
Correct answer Lawrence_Cramer

If it works fine locally but not on the server then you need to track down what is different on the server.  First, check and see that your query code doesn't have any case issues. If your site is hosted on a Linux or Unix server then "DsnName" would not be the same as "dsnname" - this would work on a Windows system because Windows is not case sensitive.  Next check with your host and tell them this works locally but not on the server and ask then to see if they can see the reason. A good host can be very helpful in these sort of situations.

Hope this helps.

--
Lawrence Cramer - *Adobe Community Professional*


http://www.Cartweaver.com
Shopping Cart for Adobe Dreamweaver
available in PHP, ColdFusion, and ASP

Stay updated - http://blog.cartweaver.com

1 reply

Lawrence_Cramer
Lawrence_CramerCorrect answer
Inspiring
September 21, 2010

If it works fine locally but not on the server then you need to track down what is different on the server.  First, check and see that your query code doesn't have any case issues. If your site is hosted on a Linux or Unix server then "DsnName" would not be the same as "dsnname" - this would work on a Windows system because Windows is not case sensitive.  Next check with your host and tell them this works locally but not on the server and ask then to see if they can see the reason. A good host can be very helpful in these sort of situations.

Hope this helps.

--
Lawrence Cramer - *Adobe Community Professional*


http://www.Cartweaver.com
Shopping Cart for Adobe Dreamweaver
available in PHP, ColdFusion, and ASP

Stay updated - http://blog.cartweaver.com