+ 2

How to connect database to PHP

2nd Mar 2017, 9:51 AM
vikit shetty
vikit shetty - avatar
3 Antworten
+ 6
I assume you want to connect to a mysql db? <?php $servername = "localhost"; $username = "username"; $password = "password"; // Create connection $conn = new mysqli($servername, $username, $password); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connected successfully"; ?>
2nd Mar 2017, 10:22 AM
RJP
RJP - avatar
+ 2
thanks
2nd Mar 2017, 10:23 AM
vikit shetty
vikit shetty - avatar
+ 1
Good
4th Mar 2017, 5:21 PM
Dellil chafik
Dellil chafik - avatar