Skip to main content
Participant
August 10, 2007
Question

Mysql connection

  • August 10, 2007
  • 6 replies
  • 607 views
I have a mysql server with my web hosting company, it has been configured and i have a table and some fields assigned. I want to test the connection within dreamweaver. I would like to send data from a form to this database. I have the form created and I would like to start to point or assign the form fields to the field names in the database. I can't seem to get a conneection from within dreamweaver to work. Any ideas what I may do to make this work?:camera;
This topic has been closed for replies.

6 replies

Participant
August 15, 2007
I found this just a bit to late. I was having issues connecting to my db via DW and found this site to be very, very helpful.

http://www.nebulex.com/index.php/tutorials/dreamweaver/mysqlphp/11?000fbdfa4e53d787c7a3170fcbb31332=8e881893e477d79b96508ec12c9df190

Turned out that when I created the connection I was only pointing to that directory and not the root. I learned on this site that in the "URL Prefix" I needed to only have the root.

example:

I had the connection pointing to http://example.com/directory/

I learned this can cause some confussion with db connection. The website above describes this very well and I then changed my "URL Prefix" to http://example.com and the connection was fixed.


I seen how you stated it Dave and just wanted to add this for others that may be still having connection issues.
Inspiring
August 10, 2007
curtkitt wrote:
> Please give my a little deeper understanding?

There's not a great deal to understand. Host directory is exactly the
same value you use when defining the remote server. It's the directory
you use to FTP pages to your website. Depending on your hosting company
setup, you might be able to leave it blank. Alternatively, you might be
told to use www, htdocs, public_html, or even something like
/home/mysite/www.

URL prefix is the URL for your website, but without anything like
index.php or default.html on the end. For a domain called example.com,
it's http://www.example.com/.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
August 11, 2007
Thank you for all of your help. It was a simple misunderstanding on my part. I was able to have it connect to the remote server and the testing server. After words we we connected to the database in the testing environment and we were able to create a php page and using the Developer Toolbox, we used the form wizard to create a simple form that can be found at:

http://emaginestudios.net/database_test.php

The form is active so you can visit the link and see the error messages that I receive. When I attempt to fill in the input fields I receive the following message after hitting the "insert record" button:


Error:
SQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''11392 Livingston Rd' 'Fort Washington' 'MD'' at line 1.
Developer Details:
SQL error: '11392 Livingston Rd' 'Fort Washington' 'MD' . (SQL_ERROR)
tNG Execution Trace - VIEW
· tNG_custom.executeTransaction
o STARTER.Trigger_Default_Starter
o tNG_custom.doTransaction
§ BEFORE.Trigger_Default_FormValidation
§ tNG_custom.prepareSQL
§ tNG_custom.executeTransaction - execute sql*
· tNG_custom.getRecordset
· tNG_custom.getFakeRsArr
· tNG_custom.getLocalRecordset
· tNG_custom.getFakeRecordset
· tNG_custom.getFakeRecordset



We seem so close but to every step we take theres another challenge. Any insight on the situation? Thanks alot.
curtkittAuthor
Participant
August 10, 2007
I have the settings panel open and I have most of the settings in place I can't seem to get the Host Directory and URL prefix right.

Please give my a little deeper understanding?
Inspiring
August 10, 2007
curtkitt wrote:
> I'm using a direct connection with my current site via FTP. I'm connected to my
> site server. I don't seem to have access to a the setting associated with a
> testing server.

Go to Site > Manage Sites. Select the Dreawmeaver site you're working
in, and click Edit. Select the Advanced tab in the Site Definition
dialog box, and then select Testing server from the Category list on the
left.

Use the following settings:

Server model: PHP MySQL
Access: FTP
FTP host: the FTP address for your site
Host directory: the path to the top level of the site (/www or
/public_html are common settings)
Login: your username for the remote site
Password: your password
URL prefix: the URL of your site

The two important settings are Host directory and URL prefix. They must
both resolve to the same place (your site root). The first is the path
for the root folder of the site. The second is the URL used to reach the
same folder.

Once you have done that, you should be able to create a MySQL connection
in a PHP page.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
curtkittAuthor
Participant
August 10, 2007
I'm using a direct connection with my current site via FTP. I'm connected to my site server. I don't seem to have access to a the setting associated with a testing server. In the Databases tab it states to use dynamic data on this page:

1.Configure a server for this file
2.Choose a document type.
Set up the server's URL prefix.

I chose PHP
Then I tried to configure the server
I selected the myqsl connection panel
I filled in the database info & tried to select a database, but it did not show up.

What can I do next?
Inspiring
August 10, 2007
curtkitt wrote:
> I can't seem to get a conneection from within
> dreamweaver to work. Any ideas what I may do to make this work?

What have you tried so far? Have you defined the testing server in your
Dreamweaver site definition?

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/