How To Create A Minecraft Lab With Mydmysqli And Minecraft

Similar documents
Application note: Connecting the to a Database

INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP

Mul$media im Netz (Online Mul$media) Wintersemester 2014/15. Übung 03 (Nebenfach)

Oracle Database 10g Express

MySQL Manager. User Guide. July 2012

Database 10g Edition: All possible 10g features, either bundled or available at additional cost.

DIPLOMA IN WEBDEVELOPMENT

Project management integrated into Outlook

Online Multimedia Winter semester 2015/16

Server side scripting and databases

Backup and Restore MySQL Databases

A table is a collection of related data entries and it consists of columns and rows.

We begin with a number of definitions, and follow through to the conclusion of the installation.

AJ Matrix V5. Installation Manual

Database Security. Principle of Least Privilege. DBMS Security. IT420: Database Management and Organization. Database Security.

The following steps detail how to prepare your database.

Installing Drupal on Your Local Computer

OrangeHRM Web Installation Guide for Windows

Equipment Room Database and Web-Based Inventory Management

Installation Instructions

Installing Drupal 8 on Windows 7 with XAMPP. I am trying to install Drupal 8 on my Windows machine as a development system.

MOODLE Installation on Windows Platform

equate Installation QUICK START GUIDE

SYSTEM DEVELOPMENT AND IMPLEMENTATION

Designing for Dynamic Content

A SQL Injection : Internal Investigation of Injection, Detection and Prevention of SQL Injection Attacks

TIMETABLE ADMINISTRATOR S MANUAL

UQC103S1 UFCE Systems Development. uqc103s/ufce PHP-mySQL 1

Tutorial: How to Use SQL Server Management Studio from Home

Online shopping store

How to Install and Setting Up Drupal

Visual FoxPro Accessing MySQL. presented to The Atlanta FoxPro Users Group June 19 th, 2007

Getting Started with Dynamic Web Sites

<head> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> <title>my First PHP Lab</title> </head>

CPE111 COMPUTER EXPLORATION

Web Hosting Control Panel Guide

LABSHEET 1: creating a table, primary keys and data types

Web Hosting Wordpress, Joomla, Drupal Integration

MySQL Quick Start Guide

SQL Injection. Blossom Hands-on exercises for computer forensics and security

How to Setup, Install & Run a Website on your Local Computer. For WordPress - on an Offline Server - WAMP

Intro to Databases. ACM Webmonkeys 2011

Wakefield Council Secure and file transfer User guide for customers, partners and agencies

Mastering Mail Merge. 2 Parts to a Mail Merge. Mail Merge Mailings Ribbon. Mailings Create Envelopes or Labels

Web Development using PHP (WD_PHP) Duration 1.5 months

MAMP 3 User Guide! March 2014 (c) appsolute GmbH!

G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P.

Equipment Room Database and Web-Based Inventory Management

Student Database Management System. Ajay Shankar Bidyarthy, Abhishek Kumar

Implementing and Maintaining Microsoft SQL Server 2005 Reporting Services COURSE OVERVIEW AUDIENCE OUTLINE OBJECTIVES PREREQUISITES

INTRODUCTION TO WEB TECHNOLOGY

Concepts Design Basics Command-line MySQL Security Loophole

Modelling with R and MySQL. - Manual - Gesine Bökenkamp, Frauke Wiese, Clemens Wingenbach

Build it with Drupal 8

Installing buzztouch Self Hosted

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE CISY 233 INTRODUCTION TO PHP

Installation of PHP, MariaDB, and Apache

Introduction to the Agency Portal

Download: Server-side technologies. WAMP (Windows), MAMP (Mac),

Seamless Web Data Entry for SAS Applications D.J. Penix, Pinnacle Solutions, Indianapolis, IN

IT360: Applied Database Systems. Database Security. Kroenke: Ch 9, pg PHP and MySQL: Ch 9, pg

Sequential Query Language Database Networking Using SQL

AtomTrack URL Rotator

Installation Instructions

Specialized Programme on Web Application Development using Open Source Tools

Installation Guide. C o p y r i g h t , S e e F i l e S o f t w a r e L L C

Website Pros Templates v1.0. Database Template Overview

SYWorks Vulnerable Web Applications Compilation For Penetration Testing Installation Guide

About (EAS) Archived Service

HowTo. Planning table online

A Brief Introduction to MySQL

Document Freedom Workshop DFW 2012: CMS, Moodle and Web Publishing

2Creating Reports: Basic Techniques. Chapter

Usage Tracking for IBM InfoSphere Business Glossary

Document Management System

Advanced Tornado TWENTYONE Advanced Tornado Accessing MySQL from Python LAB

Course 6234A: Implementing and Maintaining Microsoft SQL Server 2008 Analysis Services

CTIS 256 Web Technologies II. Week # 1 Serkan GENÇ

Course Scheduling Support System

SQL Injection. The ability to inject SQL commands into the database engine through an existing application

Databases and SQL. The Bioinformatics Lab SS Wiki topic 10. Tikira Temu. 04. June 2013

PHP+MYSQL, EASYPHP INSTALLATION GUIDE

Transferring Your Hosting Account

LAMP : THE PROMINENT OPEN SOURCE WEB PLATFORM FOR QUERY EXECUTION AND RESOURCE OPTIMIZATION. R. Mohanty Mumbai, India

How to Set Up a Website Using Joomla

When a variable is assigned as a Process Initialization variable its value is provided at the beginning of the process.

MySQL for Beginners Ed 3

Welcome To Your New Web Hosting Account!

SIMIAN systems. Setting up a Sitellite development environment on Windows. Sitellite Content Management System

PHP Tutorial From beginner to master

Example for Using the PrestaShop Web Service : CRUD

Transcription:

LAB GOALS Creating a MySQL database PHP interaction with MySQL A340 Laboratory Session #16 Step 1: Start with creating a simple database using phpmyadmin. To do so, first make sure your development environment is running (e.g., WAMP, LAMP, XAMPP, XAMPP lite, etc). Then point your browser to http://localhost/phpmyadmin you should see the phpmyadmin interface: Using the phpmyadmin GUI, create the following: A. Create a new database called MyDB B. Create a new table named my_friends, with 5 fields: (fname, lastname, email, phone, city) C. Using the GUI, Insert three records in the my_friends table. (two of them should live in South Bend, one in Mishawaka) D. Using the GUI, Display the content of the my_friends table. E. Using SQL statements, create a new user account ( LabUser ) for this lab. The user will also get some privileges to define and manipulated the my_friends database. 1

A B 2

3

C One more records should also be added. D The SQL code for INSERTing the above records is as follows: INSERT INTO `my_friends` (`fname`, `lname`, `email`, `phone`, `city`) VALUES ('Sue', 'Jackson', 'sjackson@iusb.edu', '574-555-1234', 'South Bend'), ('Tom', 'Thompson', 'tthompson@yahoo.com', '574-444-8765', 'Mishawaka'), ('May', 'Flowers', 'mflowers@gmail.com', '574-777-0123', 'South Bend'); 4

E CREATE USER 'LabUser'@'localhost' IDENTIFIED BY 'Pass123Word'; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER ON `MyDB`. * TO 'LabUser'@'localhost'; Verify the privileges for this user by clicking the SERVER and then Privileges. By clicking the EDIT icon above, you will see the following: 5

6

Step 2: Start with a simple PHP file (Lab16.php) similar to figure below. <?php // Lab 16 echo ("Step 1: Make a connection to MySQL Server and database <br />"); $con = mysqli_connect("localhost","labuser","pass123word", "MyDB"); echo ("Step 2: Check for Connection Errors <br />"); if (mysqli_connect_errno($con)) { echo "Failed to connect to MySQL: ". mysqli_connect_error(); } else echo "Successful Connection to MySQL"; echo ("Step 7: Close the connection to the MySQL server/database <br />"); mysqli_close($con);?> 7

Step 3: Run the above program. If the program indicates a Successful Connection to MySQL, then your connection to the database is good to go. Our next step is to execute some Data Manipulation statement in SQL. We start by retrieving some data from the database using the SELECT statement. Add the code below, between step 2 and 7, and then run the program again. echo ("Step 3: SELECT records in the my_friends table <br />"); $sql="select * FROM my_friends"; $result = mysqli_query($con,$sql); while($row = mysqli_fetch_array($result)) { echo $row['fname']. " ". $row['lname']. " ". $row['email']. " ". $row['phone']. " ". $row['city']; echo "<br />"; } 8

Step 4: Now add the following code between step 3 and 7, and run the program again. You should see a new record added to the table. echo ("Step 4: INSERT a record in my_friends table <br />"); $sql="insert INTO `my_friends` (`fname`, `lname`, `email`, `phone`, `city`) VALUES ('Ali', 'Fisheye', 'afisheye@iusb.edu', '574-555-6543', 'Chicago');"; mysqli_query($con, $sql); echo ("Step 4.1: SELECT records in the my_friends table <br />"); $sql="select * FROM my_friends"; $result = mysqli_query($con,$sql); while($row = mysqli_fetch_array($result)) { echo $row['fname']. " ". $row['lname']. " ". $row['email']. " ". $row['phone']. " ". $row['city']; echo "<br />"; } 9

Step 5: Now add the following code between step 4.1 and 7, and run the program again. You should see all the records with City = SOUTH BEND change to DETROIT. You should also note that the record with Ali Fisheye is now duplicated. This is because we don t have a primary key for this table, so multiple identical records can be inserted in our table. echo ("Step 5: Update a record in my_friends table <br />"); $sql="update my_friends SET city = 'Detroit' WHERE city = 'South Bend';"; mysqli_query($con, $sql); echo ("Step 5.1: SELECT records in the my_friends table <br />"); $sql="select * FROM my_friends"; $result = mysqli_query($con,$sql); while($row = mysqli_fetch_array($result)) { echo $row['fname']. " ". $row['lname']. " ". $row['email']. " ". $row['phone']. " ". $row['city']; echo "<br />"; } 10

Step 6: Now add the following code between step 5.1 and 7, and run the program again. You should see all the records with City = Chicago deleted from the table. echo ("Step 6: Delete a record from my_friends table <br />"); $sql="delete FROM my_friends WHERE city = 'Chicago';"; mysqli_query($con, $sql); echo ("Step 6.1: SELECT records in the my_friends table <br />"); $sql="select * FROM my_friends"; $result = mysqli_query($con,$sql); while($row = mysqli_fetch_array($result)) { echo $row['fname']. " ". $row['lname']. " ". $row['email']. " ". $row['phone']. " ". $row['city']; echo "<br />"; } 11