Week06 Lab
Week06 Lab
1. MySQL installation
2. phpMyAdmin Dashboard
3. Using phpMyAdmin
MySQL Installation
• Open XAMPP control panel and make sure that
Apache and MySQL service is running
phpMyAdmin
• Open a browser then type ‘localhost’ or
‘localhost:8080’ or ‘localhost:8082’
• Then navigate to ‘phpMyAdmin’
phpMyAdmin Dashboard
• Below picure shows ‘phpMyAdmin’ dashboard
• To check existing database, the user can click on
‘Databases’
• User can create database by clicking ‘New’
Create DB
• User can create database by entering the database
name click create button
• If the database successfully created then it will appear
on left menu.
Create DB
• User can create database by entering the database
name click create button
• If the database successfully created then it will appear
on left menu.
PHP and MySQL Connection
Create a php file and try out below code. If it returns
"Connected successfully" then connection between PHP and
MySQL is successful
<?php
$servername = "localhost"; // default host name
$username = “root"; // default user is root
$password = ""; //default password is empty
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
References
• MySQL - www.mysql.com
• W3Schools Online Web Tutorials- www.w3schools.com
• PHP Manual - www.php.net
Books
• Sams Teach Yourself Ajax JavaScript and PHP All in One; Phil
Ballard and Michael Moncur;
• Sams Publishing; 2010
• JavaScript Phrasebook; Christian Wenz; Sams Publishing; 2007
• PHP and MySQL Web Development, 4/E; Luke Welling and Laura
Thomson; AddisonWesley Professional; 2009
• JavaScript for Programmers Paul J. Deitel and Harvey M. Deitel;
Prentice Hall; 2009