0% found this document useful (0 votes)
10 views10 pages

Week06 Lab

Uploaded by

Rifat Talukdar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views10 pages

Week06 Lab

Uploaded by

Rifat Talukdar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

PHP and MySQL Introduction​

Course Code:CSC 3215 Course Title: Web Technologies

Dept. of Computer Science


Faculty of Science and Technology

Lecturer No: 07 Week No: 06 Semester:


Lecturer: Sazzad Hossain [email protected]
Lecture Outline

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

// Create connection using mysqli function


$conn = new mysqli($servername, $username, $password);

// 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

You might also like