Web Technologies
Android
Angular
BootStrap
ECMAScript
HTML
Image Processing
JavaScript
MVC
Onsen UI
React JS
SOAP UI
Vue.js
Cloud/DevOps Technologies
Amazon EC2
Ansible
Augmented Reality
AWS
Azure
Big Data
Cache Teachniques
Cassandra
Commercial Insurance
Cloud
CD
CI
Data Handling
Data using R
Data Science
DevOps
Gradle
Hadoop
HBase
HDFS
Hive
IOT
Jenkins
Machine Learning
MangoDB
NGINX
SOAP UI
Latest Technologies
5G Network
Agile
Android
Arduino
Augmented Reality
Commercial Insurance
C#
C++
Cyber Security
Data Handling
Data using R
Data Science
DBMS
Design-Pattern
Fortify
Ethical Hacking
Framework
GIT
GIT Slack
Image Processing
Java
Jenkins
Jira
JUnit
Kibana
Linux
MangoDB
Oracle
PHP
Python
QTP
R Language
Regression Analysis
Robotic
Salesforce
SAP
Selenium
Service Discovery
Service Now
Spark SQL
Testing
TOGAF
Research Method
Virtual Reality
Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
How can we connect to a MySQL database from a PHP script?
Home
PHP
How can we connect to a MySQL database from a PHP script?
0
votes
asked
Jun 22, 2019
in
PHP
by
SakshiSharma
(
30.8k
points)
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
(
13.1k
points)
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"); ?-->
Related questions
0
votes
How can we define a variable accessible in functions of a PHP script?
asked
Jun 22, 2019
in
PHP
by
SakshiSharma
(
30.8k
points)
#php
#php-php
#php-server-monitor-script
#php-support
#mysql-php
#php-programmer
#php-development
#php-language
0
votes
How be the result set of Mysql handled in PHP?
asked
Jun 22, 2019
in
PHP
by
SakshiSharma
(
30.8k
points)
#php
#php-php
#php-server-monitor-script
#php-support
#mysql-php
#php-programmer
#php-development
#php-language
0
votes
How can I display text with a PHP script?
asked
Jun 22, 2019
in
PHP
by
SakshiSharma
(
30.8k
points)
#php
#php-php
#php-server-monitor-script
#php-support
#mysql-php
#php-programmer
#php-development
#php-language
0
votes
How is it possible to set an infinite execution time for PHP script?
asked
Jun 22, 2019
in
PHP
by
SakshiSharma
(
30.8k
points)
#php-php
#php-server-monitor-script
#php-development
#php-support
#mysql-php
#php-language
#php-programmer
#php
0
votes
How is a constant defined in a PHP script?
asked
Jun 23, 2019
in
PHP
by
SakshiSharma
(
30.8k
points)
#php
#php-php
#php-server-monitor-script
#php-support
#mysql-php
#php-programmer
#php-development
#php-language
0
votes
How can we determine whether a PHP variable is an instantiated object of a certain class?
asked
Jun 23, 2019
in
PHP
by
SakshiSharma
(
30.8k
points)
#php
#php-php
#php-server-monitor-script
#php-support
#mysql-php
#php-programmer
#php-development
#php-language
+1
vote
How can we display information of a variable and readable by a human with PHP?How can we display information of a variable and readable by a human with PHP?
asked
Jun 22, 2019
in
PHP
by
SakshiSharma
(
30.8k
points)
#php
#php-php
#php-server-monitor-script
#php-support
#mysql-php
#php-programmer
#php-development
#php-language
0
votes
How to run the interactive PHP shell from the command line interface?
asked
Jun 22, 2019
in
PHP
by
SakshiSharma
(
30.8k
points)
#php
#php-php
#php-server-monitor-script
#php-support
#mysql-php
#php-programmer
#php-development
#php-language
0
votes
Explain how you can update Memcached when you make changes to PHP?
asked
Jun 23, 2019
in
PHP
by
SakshiSharma
(
30.8k
points)
#php
#php-php
#php-server-monitor-script
#php-support
#mysql-php
#php-programmer
#php-development
#php-language
0
votes
How can PHP and Javascript interact?
asked
Jun 22, 2019
in
PHP
by
SakshiSharma
(
30.8k
points)
#php
#php-php
#php-server-monitor-script
#php-support
#mysql-php
#php-programmer
#php-development
#php-language
...