Zen Cart Logo
Forums / Upgrading to 1.5.x / 0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

Views: 1,566

Results 1 to 10 of 10
23 Aug 2012, 1:53 PM
#1
mitch2564 avatar

mitch2564

New Zenner

Join Date:
Dec 2011
Posts:
8
Plugin Contributions:
0

0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

"0 DB_ERROR_NOT_CONNECTED
in:
[select * from znc_project_version WHERE project_version_key = 'Zen-Cart Database' ]"

this is after I enabled the strict error reporting. I understand that its something to do with the database, but what and where and how are the questions I have. So far I have made sure that the config files (both of them) are pointing at the correct database. I don't know how to check for the database password. I didn't properly save or back-up before I upgraded as I found out after everything went crazy. I am with Bluehost and their control panel makes it seem as though all I needed to do to upgrade was a few clicks and voila-which was so not the case, ergo why I am here pleading for help.

I am not sure if the admin config file is correct neither. I feel like it could be something wrong with the following:

define('HTTP_SERVER', 'http://localhost');
define('HTTPS_SERVER', 'https://localhost');
define('HTTP_CATALOG_SERVER', 'http://localhost');
define('HTTPS_CATALOG_SERVER', 'https://localhost');

and....

define('DIR_WS_ADMIN', preg_replace('#^' . str_replace('-', '-', $p1) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_ADMIN', preg_replace('#^' . str_replace('-', '-', $p2) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/');
define('DIR_WS_HTTPS_CATALOG', '/');

should I replace or add something here or is it suppose to be this way?:(

23 Aug 2012, 3:26 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,786
Plugin Contributions:
13

Re: 0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

If you are on your host's server localhost is definitely incorrect in the four defines you listed. It MIGHT be correct for the database but you need to fix the others first. You didn't use an auto loader to install ZC did you?

23 Aug 2012, 4:18 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: 0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

mitch2564:

their control panel makes it seem as though all I needed to do to upgrade was a few clicks and voila-which was so not the case
Not surprising. I've not seen any "auto-upgrade" script ever do an upgrade correctly. They should always be avoided.

Your symptoms suggest that your DB_XXXXXX settings are pointing to an empty database, and/or specifically your DB_PREFIX contains a value that's different from the pattern of the names of the tables in your database.

23 Aug 2012, 7:50 PM
#4
mitch2564 avatar

mitch2564

New Zenner

Join Date:
Dec 2011
Posts:
8
Plugin Contributions:
0

Re: 0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

dbltoe,
Yes I did. The site comes up fine, but the admin is trying to take me to h-e-doublehockeysticks. I refuse to go. Just visiting though.

24 Aug 2012, 12:45 AM
#5
mitch2564 avatar

mitch2564

New Zenner

Join Date:
Dec 2011
Posts:
8
Plugin Contributions:
0

Re: 0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

Ok, so I have checked the database and the config folder and the prefixes are the same, the database is full of tables, I put the server name in the empty spots as suggested and still same error. I've checked each line in both config files and now I don't know what else could be the problem. Could someone please point me in the direction to try and reverse this upgrade? I was more than 70percent complete in building it, and I have a lot of things pending on the site being up and running?

24 Aug 2012, 2:15 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: 0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

You said the storefront works fine but the admin does not?

Do you mistakenly have an /admin/includes/local/configure.php that doesn't belong on the server, since it overrides the correct one at /admin/includes/configure.php ?

Does your admin version of configure.php have the same DB_XXXXXXXX settings as your non-admin configure.php (the files are NOT totally identical, but all the DB_XXXXX settings should be identical). If they don't match, then I suggest copying just the DB_XXXXX settings from the non-admin configure.php into the admin one.

24 Aug 2012, 6:31 PM
#7
mitch2564 avatar

mitch2564

New Zenner

Join Date:
Dec 2011
Posts:
8
Plugin Contributions:
0

Re: 0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

Do you mistakenly have an /admin/includes/local/configure.php that doesn't belong on the server, since it overrides the correct one at /admin/includes/configure.php ?
Answer: No

Does your admin version of configure.php have the same DB_XXXXXXXX settings as your non-admin configure.php (the files are NOT totally identical, but all the DB_XXXXX settings should be identical). If they don't match, then I suggest copying just the DB_XXXXX settings from the non-admin configure.php into the admin one.
Answer: Yes

I have checked your suggestions and nothing is working. I even tried deleting the config file, redoing the zc install to see if it would create another one, but file ended up empty. I put the file back in place and tried to recreate the 1.3.9 version and put it in place-nothing. I ran zc install again and now I'm getting a 500 error. Do you have any other suggestions? I am at a loss...

24 Aug 2012, 7:26 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: 0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

mitch2564:

I even tried deleting the config file, redoing the zc install to see if it would create another one, but file ended up empty.That sounds like a permissions problem. Or something really really odd with the server you're running it on.

mitch2564:

I put the file back in place and tried to recreate the 1.3.9 version and put it in place-nothing.What does "nothing" mean in this context? Blank file?

mitch2564:

I ran zc install again and now I'm getting a 500 error.A "500" error is a generic message that means something was refused by the server. The details are not displayed by the server because it's usually a security-related thing and of course you wouldn't want hackers to see what they just triggered so they can try to work around it. Instead you want them to go away.
So the details of the 500 error can be found in the server's apache errorlog.
http://www.zen-cart.com/content.php?105-why-am-i-getting-500-internal-server-error

26 Aug 2012, 1:25 AM
#9
mitch2564 avatar

mitch2564

New Zenner

Join Date:
Dec 2011
Posts:
8
Plugin Contributions:
0

Re: 0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

The 'nothing' meant that there was no change. I think the 500 error is probably because I still have that strict error thing still there. Other than that, I don't know what else I can do besides down grade. Do you have any other suggestions?

26 Aug 2012, 1:48 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: 0 DB_ERROR_NOT_CONNECTED in [select * from znc_project_version WHERE project_version_

You skipped the proper process of doing a staged upgrade in another folder+database, and you let some automated script make a bunch of random changes to your site's files thus probably overwriting things you had customized. You need to identify what was changed incorrectly, and fix those issues.

Yes it's unfortunately rather complicated and urgent now because your live store is impacted or even "down" because of using the automated script which knows nothing of your customizations. Sorry.

Two things I'd try if I were in your shoes:
a) a fresh install (in another folder and another database) ... to satisfy yourself that you can indeed get a working copy functioning on your server
Then once that's working, simply compare your site against the working site, and fix whatever needs fixing.

b) or just jump directly to the comparison stage: http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues
These same steps are what one normally follows when upgrading anyway, so it won't hurt doing them.
And of course fix whatever needs fixing.