Home Scripting - All Others Connect to MySQL using PHP
Connect to MySQL using PHP PDF Print E-mail
Written by Siva   
Sunday, 21 November 2010 12:32

 

 

 

<?php
# connect.php - connect to the MySQL server

require_once "DB.php";

#@ _FRAG_
$dsn = "mysqli://myuser:mypass@localhost/mydatabase";
$conn =& DB::connect ($dsn);
if (PEAR::isError ($conn))
  die ("Cannot connect to server\n");
print ("Connected\n");
#@ _FRAG_
$conn->disconnect ();
print ("Disconnected\n");
?>

 

 

Last Updated on Sunday, 21 November 2010 12:39
 
 

Advertisement

Featured Links:
HREmail.com
Looking for job? Try HREmail.com
Want to have CMS based Websites?
Try siliconwebcreators.com to CMS based websites.
VM Solutions Inc
For best VM solutions..
Digital Procedure Inc.
Looking for Oracle /SAP /Weblogic Consulting services? visit digitalprocedure.com