Sunday, September 15, 2013

PHP Connection to MySQL


Before we connect to MySQL there are some parameters that we need to know
first. To make the connection, it takes:
- Server name, the name of the server or no. Where the MySQL server IP
installed
- Username, a user name that is authorized to access the database
in MySQL
- Password, a password in order to authenticate usernames owned.
- Database name, the name of the database in MySQL that we want to access.
To obtain information on the parameters above, please contact the server administrator.
While PHP commands to connect to MySQL is



mysql_connect ("name server", "username", "password") or
die (mysql_error ());
echo "Connection to MySQL Success";
?>;



The above command will display the connection to MySQL successfully if the connection has been successful,
whereas if it fails to display an error message

news source : Rosihan Ari Yuana

No comments:

Post a Comment