CENT CI
CENT CI

Reputation: 3

I tried to connect to xampp database but its failing

I am trying so hard to connect to the database but am failing, am using xampp with php 7.0.8, am confused i dont know how i should access my database. Can someone help me please?

Here is my code:

mysql_connect("localhost", "root", "") or die (mysql_error ());

Upvotes: 0

Views: 82

Answers (1)

israr
israr

Reputation: 1175

You need to use mysqli instead of mysql. As mysql extension is now deprecated. Following is the syntax for mysqli:

mysqli_connect(host,username,password,dbname,port,socket);

Upvotes: 2

Related Questions