Copy link to clipboard
Copied
I'm having problems knowing how to create my first MySQL db, I'm using DW CS4 for website development.
I have created two forms, here www.hollisterairshow.com/helpusplan.htm and here www.hollisterairshow.com/feedback/index.html , I know that PHP and MySQL are installed on the server, both of these forms assume an empty db to begin with. I must be missing something very obvious but I can't figure out how to go from having a form defined in a html document to being able to capture input from users and populate the db with their input. I'd really appreciate someone stepping me through the process, or if you could point me to a tutorial that I haven't been able to find yet. In addition to the form data I'd like to capture the date, time and IP address of the user (I may use this later to eliminate duplicate input).
Thanks so much.
Tony
Copy link to clipboard
Copied
It doesn't sound like you have even set up a DB yet... you have to create the DB and tables on your hosting server before DW can connect to it. I would contact your hosting providers help section for info on how to create a MySQL database for your hosting account.
Copy link to clipboard
Copied
Thanks, that got me going in the right direction. So now I've created
one database with one table for the "helpusplan" form. So, next step I assume is to connect the form to db right? I'll dig around in DW and try to figure that out. Thanks again.
Copy link to clipboard
Copied
There is a databases window in DW, and you can "add new MySQL connection"...
Copy link to clipboard
Copied
You are on the right track Tony.
You need to set up the connection the server then use the Server Beahaviors from the Server Behaviors panel to actually have the data submit to the databse.
This is all very common tasks and is covered quite well in the DW documentation as well.
A very good source of help on this as well if you don't mind the monthly fee is lynda.com for training videos. Best I have yet to see for Dreamweaver (butthey have videos on almost any other software as well)
Brad Lawryk
Adobe Community Professional: Dreamweaver
Northern British Columbia Adobe Usergroup: Manager
Copy link to clipboard
Copied
Brad,
Thanks for the encouragement. You're right and I agree these must be very common tasks and yet I'm having extreme difficulty in achieving them. I'm also corresponding with tech support for the ISP and they tell me the db is there, they added a test user and can connect so everything seems OK from their end and yet I can't connect to the server from DW CS4. Here's where I am:
This is a simple system and I'm the only developer so I thought I'd keep things simple by defining a single table in the MySQL db on the server and then do any testing on this db, I haven't done anything to the "Testing server" tab in DW under the "Site"/"Manage Sites". I've defined the db with a single table and added myself as a user, actually as a remote user on the advice of the ISP tech support (the ISP is lunarpages.com if that makes any difference). They tell me the db is on a different server from the web site, IP address of the db is 209.200.244.80, the web site is 209.200.244.79. So in DW CS4 I click Databases and the"+" sign and then enter the following:
Connection name "plan"
MySQL Server "209.200.244.80"
Username "myusername@%" - the % sign means I'm a remote user, myusername is the user I defined in the MySQL manager
Password "mypassword" - the password I defined in MySQL manager
I leave the database blank and click the"Select" button and get an error message "An FTP error occurred - cannot make connection to host"
Any suggestions on what could be wrong? It just must be something blindingly obvious....sigh.
Thanks.
Tony Babb
Copy link to clipboard
Copied
Hi Tony,
Going out on a limb here - obvoiusly hard to tell for sure without access, but I had a similiar issue with a client site that was hosted at godaddy.com.
That host had an option when setting up the DB to allow remote access or not. When the DB was first created the option to not allow remote access was checked therefore I could not connect with Dreamweaver. Its just something to maybe check.
Brad Lawryk
Adobe Community Professional: Dreamweaver
Northern British Columbia Adobe Usergroup: Manager
Copy link to clipboard
Copied
Hi Tony,
Another suggestion would be to have a look at a great walk-through on getting set up updated for CS4 by the very knowledgable David Powers.
http://www.adobe.com/devnet/dreamweaver/articles/setting_up_php.html
His stuff, I find to be more concise and better written than the help files.
Brad Lawryk
Adobe Community Professional: Dreamweaver
Northern British Columbia Adobe Usergroup: Manager
Copy link to clipboard
Copied
Thanks, I've noticed his responses before - always well written. It makes me wonder if my attempt to keep things simple is causing the problem. I haven't installed XAMPP or any of it's components, as this is a simple system and I'm the only developer I decided I would test on the remote server. Could not installing local copies of MySQL/PHP etc cause my inability to connect with a remote MySQL server?
Copy link to clipboard
Copied
Hi Tony,
No, you don't need to install those. I see you mentioned you didn't set
anything up on the testing server panel? Try setting up the testing
server with the same settings as the remote server.
Brad Lawryk
Adobe Community Professional: Dreamweaver
Northern British Columbia Adobe Usergroup: Manager
Copy link to clipboard
Copied
Thanks,
The default was already set up under the Site/Advanced/Testing Server tab and it was the same as my remote server.
The remote server works when I click test -and I'm able to put new html pages there. When I click test on the Testing server is when I get the error message - unable to connect. As the db is on a different server from the web site I tried replacing the domain name with the IP address and that failed also.
In a previous reply I gave the info for where the db can be found. The web hosting tech support people set up a MySQL test account holli10_lptest with a password of lptest, and gave it access to the db, they say it works. Could someone else try and get in to it? Currently I can't tell whether the problem is with my copy of Dreamweaver or with the hosting site.
Thanks,
Tony
Copy link to clipboard
Copied
I thought it might help if I post a pdf with some screen shots, see below. The web server is at 209.200.244.79 and the database is at 209.200.244.80 -at least that is what the hosting site - lunarpages.com support people tell me. In summary, I can access the web server from DW CS4 no problem, however I am unable to connect to the MySQL db. The lunarpages support people tell me the db is set up with appropriate access and they can communicate with it. I can't communicate with the server from DW as the pdf file shows. I'd really appreciate some help here, I have been dead in the water for a week now. Thanks
Copy link to clipboard
Copied
Progress !! I noticed that the web server was defined in DW CS4 as using passive FTP, but the Testing server was defined to use "Secure FTP" so I unchecked Secure FTP and DW connected when I clicked "Test". So next I went to Databases and added a connection, this time it failed, but differently from before. I recall that the db is on a different server (209.200.244.80) from the web server (209.200.244.79). Looking at the Testing Server it seems like DW assumed both are the same so, can anyone tell me what settings I have to change to point the testing server to it's real location? I've uploaded a pdf file with some screenshots here ----> http://hollisterairshow.com/Dreamweaver-lunarpages2.pdf
Thanks,
Copy link to clipboard
Copied
The testing server setting is your web server. You set the database on
when you set up your connection in the bindings panel.
Brad Lawryk
Adobe Community Professional: Dreamweaver
Northern British Columbia Adobe Usergroup: Manager
Copy link to clipboard
Copied
"The testing server setting is your web server." Right, I see that, so is that what it should be if the db is at 209.200.244.80 and the web server is at 209.200.244.79? If it's correct then shouldn't the next step be setting up a connection to the MySQL db? That's where it fails because it can't find the testing server at 209.200.244.80. I just must be missing something blindingly obvious. Thanks for your continued input.
Copy link to clipboard
Copied
Hi Tony,
You are currently working in the Site Definitions set up. There is no
place in there to set or connect to your database. Therefore the one you
should be using is the 79 one. You set up the Database connection in a
completely different place.
To set up your database connection you open a page in DW and go to the
'Database' Panel (if its not on your screen go to Window > Databases and
it will open it. Then click on the '+' sign and set your database
connections there. It will then automatically create a folder in your
site called 'Connections' which you will also need to upload to your
remote site.
Brad Lawryk
Adobe Community Professional: Dreamweaver
Northern British Columbia Adobe Usergroup: Manager
Copy link to clipboard
Copied
Got it. So assuming my web server and testing server definitions are OK the next step is to open up a page in DW, then click "Databases" and add a connection - right? I did that and got the 404 error - can't find file. I've documented this in
www.hollisterairshow.com/Dreamweaver-lunarpages3.pdf
The hosting company set up a test user "holli10_lptest" with password "lptest". Is there any chance you could try logging on with this? I have e-mails in to the hosting company support team and they can be quite slow, especially when they've escalated a ticket which they have done for the second time on this problem.
Thanks,
Tony
Copy link to clipboard
Copied
Hi Tony,
Is the the user info for the ftp or the Database? You should have two
seperate usernames and passwords. Very seldom if ever are they the same.
Brad
Copy link to clipboard
Copied
Hi Brad,
The user name (holli10_tonybabb) is the one defined for the MySQL db. The
account username is holli10 and that is the one used to define the remote
server in the site definition.
Tony
Copy link to clipboard
Copied
Hi Tony,
I am in exactly the same boat that you were when you made your initial post. Finding this discussion was like finding a large nugget of gold for me. I have multiple things to look at now.
Thanks to all for answering his questions, and don't be surprised if you see one or two more from me.
Best regards,
BrianH.
Copy link to clipboard
Copied
Hi Brian,
This forum was invaluable and got me going in the right direction. Tech support at my web hosting company were as helpful as they could be but they had no-one with DW expertise and didn't even have a copy of DW so they could replicate my problem - it turns out my problems were in DW but for a while I just didn't know where the problems were. My problem appears to be solved so I'll summarize what I did in case it helps you.
After defining my form I couldn't figure out how to connect to a MySQL db. It's obvious now but first step is to go to the Control Panel for your web hosting company and look for MySQL options. I found them and defined the db and one table - which corresponded to my form, one field on the form to one column in the table.
Next I tred to connect (click "Test" on the Testing Server page) and DW couldn't connect to the server. It turned out the problem was that I was using FTP to connect to my web server, which worked fine, but I had checked "Secure FTP" for my Testing Server (you find this under Site/ Manage Sites/yoursite/Edit), when I unchecked this I could connect to the server when I clicked "Test" on the Testing Server page.
So then I went to "Databases" and selected "+" to add a connection and then I was getting an HTTP 404 error - can't find file. It turned out the solution to this was again in the Testing Server settings where DW had set the "URL prefix" to be http://www.hollisterairshow.com/public_html - looks like it just concatenated the entries for "FTP Host" and "Host Directory" which are on the Testing Server page in Site Definitions - the same place I unchecked "Secure FTP". When I removed "public_html" from the URL prefix, leaving it as http://www.hollisterairshow.com I went to "Databases" again and clicked "+" and it found the db.
Now all I have to do is figure out how to submit my form to the db but at least the web site and the db can talk to each other. All this took roughly two weeks elapsed time, next time it'll take two minutes....sigh.
Tony
Copy link to clipboard
Copied
Thanks to all that tried to help, I really appreciated the efforts of you all. My learning curve is really steep....