Syntax:mysql_connect(servername,username,password);
servername
|
Specifies the server to connect to. Default value is "localhost:3306"
|
username
|
Specifies the username to log in with. Default value is the name of the user that owns the server process
|
password
|
Specifies the password to log in with. Default is ""
|
For example:
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// some code
?>
No comments:
Post a Comment