Active Web Hosting Logo


How To Use MySQL In PHP Pages

In order to use your MySQL Database in your PHP pages, there are a few items you must do before you can upload your page(s) to your CGI server:

  1. You must have a CGI Server Account. Choose a separate password for this account. The CGI server is not the same as your Web Space.

  2. Be sure you have activated your MySQL Database. You will need to choose a separate password for this as well.

  3. In your php page or config file that goes with your php page(s), find the area that requires a host to be entered. Fill in localhost for this.

  4. Find the area that requires your MySQL Database Username or User ID. In this area you want it set to something like yourdomaincom, substituting your actual domain name without the dot between the domain and extension.

  5. Find the area that requires your Password. This is the separate password you created when you activated your MySQL Database.

  6. Find the area(s) that require your Database or Database Name. Keep in mind that you only get one database with your Active Web Hosting account. This database name is the exact same as your MySQL Database Username. Make sure that tables being created in the database do not overwrite tables created by other PHP scripts you may install. Some PHP scripts allow you to specify a prefix to keep the tables separate for use with one set of PHP pages.

  7. Now you are ready to upload your PHP page(s). Use an FTP client to log into your CGI server. Your CGI server's FTP host address will be something like cgi.yourdomain.com where yourdomain.com represents your actual domain name. Log in with your domain name as your user name, and your CGI server password, which is a separate password from your web space FTP password that you choose when you activate your CGI Server Account.

  8. To access your PHP page(s), point your web browser to http://cgi.yourdomain.com/yourpage.php where yourdomain.com represents your actual domain name and yourpage.php represents the PHP page you uploaded (or if a set of pages, this might usually be index.php or config.php, for example).

If you would like to access and work with your database, you can use phpMyAdmin. Log in using your MySQL Database Username and MySQL password.

 


Home - Support - Management - About Us
... Active Web Hosting, 1445 American Pacific Dr. Ste 110-318, Henderson, NV 89074 ...
Toll-Free (800) 946-7764   Fax: (702) 567-1831