Find code and diagrams at: https://www.EliTheComputerGuy.com
You can use the built in MySQLi Extension with PHP to connect your PHP scripts to a MySQL Database.
Environment – LAMP stack on Ubuntu 18.04 Desktop using tasksel
gEdit – Preferences - Display Line Numbers, Highlight matching brackets
Create Apache Accessible Directory with user write permission
sudo mkdir /var/www/html/php
sudo chown username /var/www/html/php
PHP Code (connectTest.php)
?php
$servername = "localhost";
$username = "username";
$password = "password";
$conn = new mysqli($servername, $username, $password);
if ($conn-connect_error) {
die("Connection failed: " . $conn-connect_error);
}
echo "Connected successfully";
?
Watch video MySQL - Connect with PHP (mysqli) online without registration, duration hours minute second in high quality. This video was added by user Eli the Computer Guy 06 December 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 9,539 once and liked it 162 people.