If the connection are established, you can create databases, tables, or insert data and anything with MySQL database. The PHP syntax which use to create connection is mysql_connect( host, user, pass ) . Below the example script for create connection to MySQL databases.
<?phpSave and access that script. If the display is "Connection established" without error, so your connection is successfull.
$host = "localhost"; // if your host is localhost
$user = "root"; // if your user in MySQL is root
$pass = ""; // if your MySQL without password
// create connection
mysql_connect($host, $user, $pass) or die (mysql_error());
echo "Connection established"
?>
Paper 4Share - PHP Connect to MySQL
0 Response to "PHP Connect to MySQL"
Post a Comment