Login
Remember
Register
Ask a Question
How can we connect to a MySQL database from a PHP script?
0
votes
asked
Jun 22, 2019
in
PHP
by
SakshiSharma
How can we connect to a MySQL database from a PHP script?
#php
#php-php
#php-server-monitor-script
#php-support
#mysql-php
#php-programmer
#php-development
#php-language
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jun 22, 2019
by
john ganales
To be able to connect to a MySQL database, we must use mysqli_connect() function as follows:
<!--?php $database = mysqli_connect("HOST", "USER_NAME", "PASSWORD"); mysqli_select_db($database,"DATABASE_NAME"); ?-->
...