post your comment   print   send to a friend
Rate:  87% | Views: 6043
Question categories:  MySQL

 How Can MySql be accessed through PHP scripts?

Answer by: George Kaloyanov, Aplus.Net Knowledge Base Support

MySQL can be accessed through PHP scripts. You are going to need to know the following information.

The information you need to know is:

  • Hostname: You can use localhost or the name of the server that hosts your web space.
  • MySQL Database Username: The username of your specific MySQL Database based on your Main FTP Username.
  • MySQL Database Password: The password you set when adding your database to your plan.

Your connect script will look something like

mysql_connect(“hostname”, “mysql_username”, ”mysql_password”)

Note: If you do not know the hostname of your shared hosting server, please contact our Customer Support team by phone at 1 888 301 2516 (toll free) or 1 858 410 6900 for international callers. You may contact Customer Support by email at , please include your registration number so we can locate your account.

You can test your MySQL connection through PHP script by creating a simple php script using the following code:

<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
   die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

Related links:

Customer Feedback
Rate:  87% | Views: 6043 | Please Rate:  
 
If you have other comments or ideas for future technical tips, please type them here:

Email: (optional)

Comments: (optional)

 Dedicated Server | PHP Hosting    Back to serch results
Browse the Base
Knowledge Base
Shared Hosting
  Unix Plans
    MySQL
Messages
 

FREE Remote File Storage Service!

Web-a-File by Aplus.Net is a complimentary service that comes as a bonus with your web hosting packages. Typical applications include backup, disaster recovery, and file sharing.  Now you can send large files that would otherwise be rejected by the e-mail system of the recipient.  Feature-rich, easy to use, completely secure. Click below to learn more!
more info ...

Private Area
 
Ask
in Private
   
Personal
Folder
 
Related Questions
 
1. How to set up an additional MySQL Database?
 
2. How do I get MySQL access?
 
3. What is the size limit for MySql Databases?
 
4. Where can I get a good MySQL authoring tool?
 
5. What is the size limit (in Megabytes) for MySql Databases under the plans that support MySQl Databases?
 
Related Articles
 

How to Select a Web Site Hosting Company.

Home Browse Search Ask in Private Personal Folder   Help
powered by web hosting 
  Logged as: Guest