Webastor - Programming Tips and Tricks

Programming language => PHP => Topic started by: Lee on November 17, 2016, 07:04:54 PM

Title: Can anyone give mi the connectivity code for PHP?
Post by: Lee on November 17, 2016, 07:04:54 PM
Hello everyone, I would like to ask you if you can tell me can anyone give mi the connectivity code for php? Thank you please reply to the message!
Title: Re: the connectivity code for PHP?
Post by: Vincent on January 09, 2018, 06:38:33 PM
PHP will require that mysqli is enabled (it is on most PHP set ups).

<?php
//Step1
$db = mysqli_connect('localhost','username','password','database_name')
or die('Error connecting to MySQL server.');
?>

<html>
<head>
</head>
<body>
<h1>PHP connect to MySQL</h1>
</body>
</html>