Here is a simple code to connect to MySQL from PHP assumnig MySQL.
<?php
$user="MySQL-Username";
$password="Password";
// Connect to MySQL
if ( !( $db = mysql_connect( "localhost","root", "" ) ) )
die( "Could not connect to database" );
// open networks database
if ( !mysql_select_db( "dbname") )
die( "Could not open the database" );
print("Connected to MySQL!!");
?>
Tuesday, July 17, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment