MySQL - Connect with PHP (mysqli)

MySQL - Connect with PHP (mysqli)

Find code and diagrams at: https://ift.tt/2zY82iQ 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"; ?

View on YouTube
MySQL - Connect with PHP (mysqli) MySQL - Connect with PHP (mysqli) Reviewed by iot portal on 9:27 AM Rating: 5

No comments:

Powered by Blogger.