close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

message No database selected

Thread began 2/23/2010 6:32 pm by donald.dickson338135 | Last modified 2/24/2010 11:02 am by Office Guy-172461 | 4703 views | 7 replies |

donald.dickson338135

message No database selected

Hello I need some basic help here because I cannot work out what I am doing wrong.
I am slowly working through this Solution Pack and my current challenge is overcoming the "No database selected" message.
I am runing XAMP with Apache and MySQL as a local host on Windows Vista with IIS turned off. I use Dreamweaver CS3
Page results as follows
users_LogIn.php?accesscheck=%2Fphptest%2Fusr_reg%2Fusers_LogOut.php
The above page loads OK

users_Registration.php
This page displays the message No database selected

users_EmailPW.php
This page displays the message No database selected

The MySQL Connection test passes OK so I do not understand why there is no database connection

I looked at these support pages and spotted a similar issue except that my localhost php file content has one less line.
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_localhost = "localhost";
$database_localhost = "users.sql";
$username_localhost = "root";
$password_localhost = "dicksdo1025";
$localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);
?>

I have tried changing line 6 by removing .sql from users.sql and saving the file but next time I open the file in notepad the .sql is back!

Clearly I have not completed one of the pages in the Solution pack correctly but which ones and what needs to be changed?

Sign in to reply to this post

Office Guy-172461

You have to import the database into mysql using the users.sql script:

See

Exporting and Importing a database using phpMyAdmin
150/

Then you put the name of the database you created in the $database_localhost =
variable.

Sign in to reply to this post

donald.dickson338135

message No database selected

Hello and thank you for your reply however I had completed that task already.
I previously used MySQL Query Browser following both the WebAssist PDF and the WebAssist Video Tutorial. The screen grab MySQL_QB_Schemata.jpg identifies database table imported.
The screen grab MySQL_Admin_Schema.jpg shows the table view in MySQL Admin
I created the database connection using the WebAssist help file following the instructions for Are you a Dreamweaver user?
The Customizing the WA_Globals.php I have not modified the CAPTCHA settings and I have modiefied the Email settings for email server and "From" fields
The Admin Section I have not modified as I am under the impression that this only needs modifying prior to uploading the files to a live server.

The last jpeg is a screen grab of the Local Files panel within Dreamweaver.
The Local Files are stored in my Documents folder and the testing server is set up for localhost in C:/XAMP/htdocs

I do have a remote "live" server that I have set up for live testing but this is not connected yet to the files within Dreamweaver.

I have re-imported the database (see screen grabs) and updated the Connection localhost file
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_localhost = "localhost";
$database_localhost = "users";
$username_localhost = "root";
$password_localhost = "dicksdo1025";
$localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);
?>

Trying to make sense of the code in the PHP files I can't see how the database "users" is located in the Database folder in the website. There does not seem to be a path statement along the lines of Database/users - or maybe in PHP you do not need this?

It could be that I have made the website structure too complicated, I am using the same website to try out User Registration as well as another Sample Site from WebAssist. Maybe that is the problem?

Can you see anything in the above or in the screen grabs that is giving rise to this problem? Maybe I should start all over again with a new site built directly on a live test server?
I have now spent two days trying to move forward.

My most recent attempt to load the user registartion web page resulted in a can't find table "users" so I suspect that the problem is something that I have not done correctly.

Appreciate your thoughts on this.
Thanks.

Sign in to reply to this post

Office Guy-172461

OK, I think it's just a matter of terms.

The database lives in the mySQL database server, not in the file system.

  • A database is a collection of tables.
  • A table is a collection of rows (or records)
  • A row is a collection of columns (or fields)


In your image, you have named your database users_sql (could be just about any name). When you inported the .sql script, it created a table called users.

So you should change:

$database_localhost = "users";
to
$database_localhost = "users_sql";
so that it matches the database name you have in the mySQL server.

You can completely remove the Database folder from your Dreamweaver site because you only use the users.sql file once to import the table into your database. All of your data will be stored on the mySQL server database (users_sql)

Your screen grabs were very helpful and you're asking all the right questions. :)

Sign in to reply to this post

donald.dickson338135

Excellent diagnosis

Hello - when I was a young lad (I am 63 yrs old now) and we were amazed at something (that should have been obvious) the expression was "Well I will go to the front of our back door!"
The said expression was to signify how something simple could cause so much angst!
I am grateful for your support because now I have the Register pages (both types) displaying. This is indeed a step forward for me!

Next step is to see if I can add entries into the database by setting up some login IDs.

1 - Would I be correct in concluding that this can only be done from a live server given that I do not have a mail server on my own PC?

2 - Also, I have set up a subdomain as a live test server and allocated an email address to that subdomain. Will there be any issue using subdomain urls and email in PHP? For example www.testserver.mydomain.com can give an email address admin@testserver.mydomain.com

3 - I use the recommended provider 1&1 for the shared hosting service and the email send they use auth.smtp.1and1.co.uk - should there not be a password required to send email via the auth.smtp service?

4 - I tried registering on my localhost test server but got a message that the sender domain (the sub domain) was misconfigured citing WA_Universal_Email\mail_PHP.php line 257 (but I know that the subdomain is a valid url and I suspect that line 257 is calling the url fromWA_Globals.php) and a second message cannot modify header info citing users_registration_Simple.php line 114

5 - Ummmh ... Using the log in page on localhost I now see that the registration took place using localhost but that there was an issue with sending the registration email - I suspect this is related to there being no mail server on my computer?
The saga continues!
Don

Sign in to reply to this post

Office Guy-172461

Congratulations.

I've been to the front of the back door a few times myself. Most things with computers are very simple as soon as you understand exactly what the computer is asking for (that be the hard part). :)

1. Yes your local computer does not have a mail server by default, so it's easiest to test on a live server.

2. It might be easier to just test in a folder without trying to get a subdomain working.

3. Most hosts will allow you to just leave the mail server setting blank and it will use the default mail server for your domain. You normally only have to authorize when you are sending email from outside the server.

4. You need a mail server to complete this part. Try it on the remote server.

5. Yep. I think your almost there.

Sign in to reply to this post

donald.dickson338135

Almost There

Thank you again - very reassuring to learn I am almost there.
I will now set about learning how to upload to the live server .. I can see there may be a few pitfalls for the unwary so I will follow the WebAssist help file step by step once more!
So this could take some time <grin>
Time for a coffee and a re-read!
Thanks again.
Don

Sign in to reply to this post

Office Guy-172461

You're most welcome.

Don't get discouraged if something goes wrong. As you discovered, it is often a very small setting that produces multiple error messages. Most of the time it's not as bad as it looks. Think of it as a puzzle to solve, instead of a roadblock.

Sometimes it takes a couple of cups of coffee before it makes sense. :)

Sign in to reply to this post

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...