close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

PHP pages not connected to MySQl database on hosted site

Thread began 8/15/2009 1:45 pm by cmartimo386205 | Last modified 6/10/2011 6:44 am by Jason Byrnes | 5917 views | 13 replies |

cmartimo386205

PHP pages not connected to MySQl database on hosted site

I have created a website with Dreamweaver and successfully have connected my *.php pages to the MySQL database. When I upload my site to my webhost (1and1), my php pages no longer can find the MySQL database because they are looking for it on the testing server.
I get the following error:

Fatal error: main() [function.require]: Failed opening required 'Connections/db1996.php' (include_path='.:/usr/lib/php') in /homepages/44/d289565916/htdocs/drygoods/PATTERNS.php on line 5

which you can see in person at patterns.php

What information should I be adding on line 5?

thanks
cindy

Sign in to reply to this post

I-CRE8Beta Tester

The error that you have provided suggests that you have not uploaded Connections/db1996.php. So to start with make sure that your remote site contains this file and then ensure that the connection information contained match what your host gives you.

Sign in to reply to this post

cmartimo386205

Still not working

The File Connections is there and in it is the db1996.php file. The php file contains the correct database name, host name, password, etc. I am disappointed that the eCart and DataAssist products contain no information about how to put your site online. Only how to run it on your computer.

Sign in to reply to this post

I-CRE8Beta Tester

That page cannot find the connection file, that's what the message means, looking at the message again I suspect that the connection file is in location /htdocs/Connections/db1996.php which means that the link to your connection file should look like this:
<?php require_once('../Connections/db1996.php' ?> and not <?php require_once('Connections/db1996.php' ?> note the extra "../"

Sign in to reply to this post

cmartimo386205

same error

Thank you for the suggestion but now my error is slightly different:

Fatal error: main() [function.require]: Failed opening required '../Connections/db1996.php' (include_path='.:/usr/lib/php') in /homepages/44/d289565916/htdocs/drygoods/PATTERNS.php on line 5

PATTERNS.php

Any other thoughts?
thanks
cindy

Sign in to reply to this post

I-CRE8Beta Tester

Cindy,

there is a problem with the paths to your files or your connection folder is in the wrong place can you give the full path to your connection folder ?

Sign in to reply to this post

cmartimo386205

full path

The path to my connection on my home computer looks like this:

C:\inetpub\wwwroot\drygoods\connections\connDGD.php

when I upload the drygoods folder to 1and1 the webspace explorer looks like this:

\drygoods\connections\connDGD.php

I am very new at this, but everything is working on my computer. I am assuming that because the MySQL database is in a different location that it was that the connDGD.php file cannot find it - therefore the error. I do not know what to include in either file to point one towards the other. 1and1's FAQ do not include any info about it, so I assume it is just something I should know, but don't.

thank you
cindy

Sign in to reply to this post

I-CRE8Beta Tester

Originally Said By: cmartimo386205
  The path to my connection on my home computer looks like this:

C:\inetpub\wwwroot\drygoods\connections\connDGD.php

when I upload the drygoods folder to 1and1 the webspace explorer looks like this:

\drygoods\connections\connDGD.php  



In the orinal error message you provided it was "Connections" with an Upper Case C and not "connections" all lower case maybe this is the cause of your frustration ?

Also given where your file is you would need to change the include to look like this I suspect
<?php require_once('connections/db1996.php' ?>

Sign in to reply to this post

cmartimo386205

new problem

Okay, so changing the folder to a capitol "C-(Connections)" fixed that. And I put in the 1and1 required hostname, username and password and now I have this error:

No database selected

patterns.php

cindy

Sign in to reply to this post

I-CRE8Beta Tester

If that is the case either you have not uploaded your database from your machine to 1and1 or there is a problem with the connection information you have entered.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...