Serving Global Customers for Over a Decade
Contact Us
logo
  • Home
  • About 3TEC.COM
  • Infrastructure
    • Data Centre and Network
    • Zero Downtime Architecture
  • Services
    • Content Hosting
    • DNS Hosting
    • Domain Name Registration
    • Content Development
    • Order Now!
  • Tutorials
    • General Information
    • Getting Started
    • Domain Names
    • Uploading / FTP Questions
    • Microsoft FrontPage Support
    • MySQL Database Support
    • Java and PHP Applications
    • Common SSL Questions
  • Customer Care
Home Tutorials MySQL Database Support How do I connect to MySQL database using PHP?

How do I connect to MySQL database using PHP?

To access your database using PHP, you will need the following code to initiate the database connection:
			  
$link = mysql_connect ("localhost", "username", "password")
or die ("Could not connect");
print ("Connected successfully");
mysql_close ($link);

For more information on MySQL and PHP, please refer to PHP's MySQL Functions.

MySQL Database

  • Where can I find MySQL documentation or manual?
  • Can I use CGI to access MySQL database?
  • Do you offer web-based MySQL database management interface?
  • How do I connect to MySQL database using PHP?
  • How do I connect to MySQL database from my Java applications?
  • Privacy Policy
  • Terms of Service
  • Acceptable Usage Policy
  • Service Level Agreement