Home > DeveloperSection > Interviews > Which function is used to connect with database in PHP?

Posted on    September-26-2016 1:26 AM

 PHP PHP 
Ratings:
 2 Answer(s)
  208  View(s)
Rate this:

zack mathews
zack mathews

Total Post:5

Points:25
Posted on    September-26-2016 1:26 AM

PHP provides mysqli_connect() function to connect with database. This function has five parameter:

a)    Server: The host name running the database. If not defined then by default it is localhost.

b)   User: The username who is accessing the database.

c)    Password: The password given by the user who is accessing the database.

d)   new_link(): no new connection will be established.

e)    Client_flags : MYSQL_CLIENT_COMPRESS-use Compression protocol.


KIRTI SHARMA
KIRTI SHARMA

Total Post:4

Points:20
Posted on    March-08-2017 10:00 PM

mysql_connect("Host name","user name","password");

Don't want to miss updates? Please click the below button!

Follow MindStick