Reputation: 3
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
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