Community Forums

New server - database installed but error

Please post any issues you are having concerning installation or upgrade of OpenCart v1.x

New server - database installed but error

Postby matthew-marc » Wed Jul 25, 2012 9:33 am

Hello,

I have taken over a project from a colleague who has left the company. He had started to move http://www.premier-products.co.uk from his own server to our 1and1 hosting account.

He backed up the database to a .sql file, which I have installed in a new 1and1 database. I can see all the information is there so the database is installed. 1and1 assisted with this. However, when you visit the URL there is the following error:

Notice: Undefined variable: db in /homepages/23/d409796783/htdocs/premier/index.php on line 41

Fatal error: Call to a member function query() on a non-object in /homepages/23/d409796783/htdocs/premier/index.php on line 41


I'm not well-versed in php to fix it. Can you help?

Tech Specs
OpenCart 1.5.1
New server PHP version: 5
New server MySQL version: 5.0

Matthew
matthew-marc
 
Posts: 4
Joined: Wed Jul 25, 2012 9:23 am

Re: New server - database installed but error

Postby webvet » Wed Jul 25, 2012 10:53 am

Has your database been installed with a prefix?
Genuine, Honest Opencart Support @ http://webvetservices.com
User avatar
webvet
 
Posts: 219
Joined: Wed May 13, 2009 6:04 pm
Location: Shropshire, UK

Re: New server - database installed but error

Postby matthew-marc » Wed Jul 25, 2012 11:29 am

There is no prefix - it was empty/blank. See attached screenshot of the database.

Thanks for your reply.
Attachments
database.JPG
MySQL database on 1and1 screenshot
database.JPG (52.61 KiB) Viewed 212 times
matthew-marc
 
Posts: 4
Joined: Wed Jul 25, 2012 9:23 am

Re: New server - database installed but error

Postby webvet » Wed Jul 25, 2012 11:44 am

Essentially - the database information (prefix, name, password etc) is outlined in the root config.php (and admin/config.php) files.

Your next sensible step is to check the root config.php file - at the bottom (about line 23-25 ish) are half a dozen lines of code that need to match how the database was set up by 1and1.

Does that make sense?
Genuine, Honest Opencart Support @ http://webvetservices.com
User avatar
webvet
 
Posts: 219
Joined: Wed May 13, 2009 6:04 pm
Location: Shropshire, UK

Re: New server - database installed but error

Postby matthew-marc » Wed Jul 25, 2012 11:58 am

Yes, the config files have been updated to the new server details. See screenshot:
Attachments
config screenshot.JPG
Config root file
config screenshot.JPG (111.14 KiB) Viewed 208 times
matthew-marc
 
Posts: 4
Joined: Wed Jul 25, 2012 9:23 am

Re: New server - database installed but error

Postby matthew-marc » Thu Jul 26, 2012 8:35 am

Anyone have an idea what the fault is?

Notice: Undefined variable: db in /homepages/23/d409796783/htdocs/premier/index.php on line 41

Fatal error: Call to a member function query() on a non-object in /homepages/23/d409796783/htdocs/premier/index.php on line 41
matthew-marc
 
Posts: 4
Joined: Wed Jul 25, 2012 9:23 am


Return to Installation, Upgrade, & Config Support

Who is online

Users browsing this forum: mikeltn, rebortec and 23 guests

Hosted by Arvixe Web Hosting