how can we connect to a mysql database from a php script?

Report
Question
1670 views

To be able to connect to a MySQL database, we must use mysqli_connect() function as follows:

Please explain why do you think this question should be reported?

Report Cancel
<?php $database = mysqli_connect("HOST", "USER_NAME", "PASSWORD"); mysqli_select_db($database,"DATABASE_NAME"); ?>
PHP

Thread Reply

Leave an comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>