ADDR Logo Effective Online Solutions
home | about us  | solutions | partners | careers | contact
1-877-528-4850 |   Chat with a Rep   |   Order Now Help Center   |   Control Panel 
 
  HELP CENTER
 
Getting Started
FAQ - List of Frequently Asked Questions
How Tos
I am having a problem with...
Explanation of features
For advanced users
Glossary of terms
Searching
Quick submission forms for setup requests and reporting problems
 
Your Question Was...
  How do I connect to a mySQL database using PHP3 or PHP4?
 
The script below is an example of how you may connect to a mySQL database using PHP3 or PHP4. You may also use it to test connectivity to your database. Remember to substitute your own information as necessary, for your particular database configuration. The $DBHost variable MUST remain as stated at this point in time in order to connect to the mySQL server.

This script will run with permissions of: 644.


$DBName = "(your data base name)";
$DBUser = "(your data base user name)";
$DBPass = "(your data base password)";
$DBHost = "mysql.addr.com";

$link = mysql_connect ( $DBHost, $DBUser, $DBPass )
or die ( "Could notconnect

print ( "Connected to mysql server successfully

mysql_select_db ( $DBName )
or die ( "Could not select database

print ( "Connected to database successfully

mysql_close ( $link );

?>

 
 
 
CONTROL PANEL  
Username
Password
 
CORPORATE INFO
AT A GLANCE STATS
  Pages served today:
9586060
Emails processed today:
988791
Today's new clients:
78
 
HELP CENTER    
  1-877-528-4850
  Live Chat
  We'll Call You
SITE MAP  
 TESTIMONIALS  
All Testimonials
  About ADDR.com : Web Hosting : Web Design : E-Commerce : Reseller Program : Affiliate Program : Domain Lookup : Privacy Policy : Contact Us
   Copyright © 1997 - 2007 ADDR.com, Inc. All rights reserved.