MySQL connect to database

Description

This is for the basic snippet to connect to a MySQL database.

Snippet

mysql_connect("localhost", "USERNAME", "PASSWORD") or die(mysql_error());

mysql_select_db("DATABASENAME") or die(mysql_error());

Post new comment

The content of this field is kept private and will not be shown publicly.