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




# 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


Featured Links:
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