PDA

View Full Version : MySQL connection in Dreamweaver


shelbali
March 23rd, 2006, 06:54 PM
I'm having very frustrating problems trying to get my website to connect to my MySQL database and hoped someone might be able to help. I'm using MySQL, PHP and Apache (installed as WAMP). Everything's running fine and I've created a database containing several tables. I have managed to create the MySQL connection in Dreamweaver but each time I try and view the php file on my webserver Dreamweaver prompts me to specify and existing server. I've done this over and over again and just seem to be stuck in a loop. I did manage to view the database connection in Dreamweaver using the live data view button, but it has since stopped working problem.

I desperately need this to help me finish my university dissertation. I'd be very grateful for any help.

degsy
March 23rd, 2006, 07:00 PM
Welcome :)

You have created a site and a testing server?
What details do you have for your testing server?
What details do you have for the connection string?

shelbali
March 23rd, 2006, 07:10 PM
Welcome :)

You have created a site and a testing server?
What details do you have for your testing server?
What details do you have for the connection string?
You'll have to forgive me, I'm new to using Apache and MySQL.
Yes I've created a site and a testing server. I've been saving my php pages to my site and then trying to view them via my localhost.

Thanks for the welcome.

Sorry to sound stupid, but what do you mean by connection string? I'm getting this message on my testing server:
Warning: require_once(../../../Documents%20and%20Settings/Administrator/My%20Documents/newgo/Connections/newgo.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\newgo\home.php on line 1

Fatal error: require_once() [function.require]: Failed opening required '../../../Documents%20and%20Settings/Administrator/My%20Documents/newgo/Connections/newgo.php' (include_path='.;C:\php5\pear') in C:\wamp\www\newgo\home.php on line 1

degsy
March 23rd, 2006, 07:17 PM
When you setup the mySQL connection in DW it will create a file in a folder called Connections.

You need to upload this folder to your webserver (e.g. C:\wamp\www )
Also, it looks as though it is looking for the wrong path aswell.
The Require file should be from the webroot, not the physical path.



(../../../Documents%20and%20Settings/Administrator/My%20Documents/newgo/Connections/newgo.php


Should be

require_once('Connections/newgo.php')




Save the file first, upload it, then load it via localhost.
Dreamweaver should add the correct path for you.

shelbali
March 23rd, 2006, 07:57 PM
Thanks for your help. I just seem to be getting nowhere with this. I've tried copying the file from my connections folder to my local host (www) but it makes no difference to the error message.
Also the root you suggested doesn't appear to be in my file structure. There is no folder administrator->my documents....

Sorry to be such a pain, but this is just driving me crazy....

shelbali
March 23rd, 2006, 08:22 PM
Okay, so I copied the Connections folder to my root (www) folder. I've refreshed the localhost page but I'm still getting the error message I quoted above. Any other suggestions please? I'm grateful for your patience! :o)

degsy
March 23rd, 2006, 08:26 PM
There seems to be a problem with your site configuration.

As a test I would create a new site using the Dreamweaver Basic Site Wizard

degsy
March 23rd, 2006, 08:28 PM
Also as a test, open home.php and change the line to


require_once('/Connections/newgo.php')

shelbali
March 27th, 2006, 08:14 PM
Many thanks for your help the connection problem has now been sorted