Introduction to PHP and MySQL – Creating Database-Driven Websites

Slides:



Advertisements
Similar presentations
MySQL. To start go to Login details: login: labuser password:macimd15 – There.
Advertisements

Day 3 - Basics of MySQL What is MySQL What is MySQL How to make basic tables How to make basic tables Simple MySQL commands. Simple MySQL commands.
Exploring Microsoft Access 2003 Chapter 1 Introduction to Microsoft Access: What Is A Database?
Quick-and-dirty.  Commands end in a semi-colon ◦ If you forget, another prompt line shows up  Either continue the command or…  End it with a semi-colon.
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, Copyright © 2010 All Rights Reserved. 1.
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, Copyright © 2010 All Rights Reserved. 1.
DAT702.  Standard Query Language  Ability to access and manipulate databases ◦ Retrieve data ◦ Insert, delete, update records ◦ Create and set permissions.
1 CS428 Web Engineering Lecture 23 MySQL Basics (PHP - VI)
MySQL Dr. Hsiang-Fu Yu National Taipei University of Education
Session 5: Working with MySQL iNET Academy Open Source Web Development.
INTERNET APPLICATION DEVELOPMENT For More visit:
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
 SQL stands for Structured Query Language.  SQL lets you access and manipulate databases.  SQL is an ANSI (American National Standards Institute) standard.
Web Application Development. Tools to create a simple web- editable database QSEE MySQL (or PHPMyAdmin) PHP TableEditor.
Dbwebsites 2.1 Making Database backed Websites Session 2 The SQL… Where do we put the data?
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
MySQL. MySQL is a Relational Database Management System (RDBMS) that runs as a server providing multiuser access to a number of databases. A third party.
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
Chapter 4 Introduction to MySQL. MySQL “the world’s most popular open-source database application” “commonly used with PHP”
Introduction to MySQL Lab no. 10 Advance Database Management System.
Introduction to Internet Databases MySQL Database System Database Systems.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
MySQL Databases & PHP Integration Using PHP to write data to, and retrieve data from, a MySQL database.
Database and mySQL Week 07 Dynamic Web TCNJ Jean Chu.
Database Fred Durao What is a database? A database is any organized collection of data. Some examples of databases you may encounter in.
Kirkwood Center for Continuing Education Introduction to PHP and MySQL By Fred McClurg, Copyright © 2015, Fred McClurg, All Rights.
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
Login to a Database (from a Webpage), Inserting data into a database from a form, getting data from database and display on Webpage Done by: Mashail Alsolamy.
1 DIG 3134 – Lecture 14 MySQL and PHP Play Together Michael Moshell University of Central Florida Media Software Design.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
MySQL Importing and creating a database. CSV (Comma Separated Values) file CSV = Comma Separated Values – they are simple text files containing data which.
>> Introduction to MySQL. Introduction Structured Query Language (SQL) – Standard Database Language – Manage Data in a DBMS (Database Management System)
There are two types of MySQL instructions (Data Definition Language) DDL: Create database, create table, alter table,,,. (Data Manipulation Language) DML.
Introduction to MySQL Ullman Chapter 4. Introduction MySQL most popular open-source database application Is commonly used with PHP We will learn basics.
Working with MySQL A290/A590, Fall /07/2014.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
Programming for the Web MySQL Command Line Using PHP with MySQL Dónal Mulligan BSc MA
COM621: Advanced Interactive Web Development Lecture 10 PHP and MySQL.
Marketing Analytics: Database Query with MySQL Disclaimer: All logos, photos, etc. used in this presentation are the property of their respective copyright.
3 A Guide to MySQL.
Web Systems & Technologies
CS320 Web and Internet Programming SQL and MySQL
Understanding SQL Statements
Basic Database Concepts
Open Source Server Side Scripting Permissions & Users
Database Keys and Constraints
Referential Integrity MySQL
Session 4 PHP & MySQL.
Web Design and Development
CS311 Database Management system
MYSQL and WAMP On LocalHost
Lesson 7 Managing Data Creating a database with Web Matrix.
Intro to MySQL 1.
Chapter 7 Working with Databases and MySQL
Chapter 8 Working with Databases and MySQL
PHPMyAdmin.
MySQL Dr. Hsiang-Fu Yu National Taipei University of Education
What is a Database? A collection of data organized in a manner that allows access, retrieval, and use of that data.
CS122 Using Relational Databases and SQL
CS3220 Web and Internet Programming SQL and MySQL
CS1222 Using Relational Databases and SQL
Chapter 4 Introduction to MySQL.
MySQL Database System Installation Overview SQL summary
CS3220 Web and Internet Programming SQL and MySQL
MySQL Database System Installation Overview SQL summary
CS122 Using Relational Databases and SQL
SQL NOT NULL Constraint
SQL AUTO INCREMENT Field
Presentation transcript:

Introduction to PHP and MySQL – Creating Database-Driven Websites - Using WAMP

Introduction to PHP and MySQL – Creating Database-Driven Websites Connecting to MySQL database on your WAMP Web Server Start / Run.. Enter mysql –h localhost –u root –p There is no password set by default on WAMP Server. Do NOT set a password.

Introduction to PHP and MySQL – Creating Database-Driven Websites Connecting to MySQL database on your WAMP Web Server Start / Run.. Enter mysql –h localhost –u root –p Or Access the command line interface using WAMP’s pop-up menu

Introduction to PHP and MySQL – Creating Database-Driven Websites MySQL commands: Show databases; Use database-name; Explain table-name; or describe table-name;

Introduction to PHP and MySQL – Creating Database-Driven Websites MySQL commands: Create database garage; Show databases; Use garage; Create table cars(id int, make text, model text); Describe cars; Drop table cars;

Introduction to PHP and MySQL – Creating Database-Driven Websites MySQL commands: Create table cars (id int auto_increment, make varchar(20) not null, model varchar(20) not null unique, primary key (id) ); Explain cars; Insert into cars values (1, “Porsche”, “Carrera”); Select * from cars; Insert into cars (make, model) values (“Ferrari”, “Dino”), (“Lamborghini”, “Diablo”);

Introduction to PHP and MySQL – Creating Database-Driven Websites MySQL commands: Alter table cars add top_mph int; Select * from cars; Update cars set model = “911 Turbo” where id=1; Update cars set model = “F355” where make=“Ferrari”;

Introduction to PHP and MySQL – Creating Database-Driven Websites MySQL commands: Update cars set model = “Murcielargo” where make=“Lamborghini”; Update cars set top_mph=189 where id=1; Update cars set top_mph=183 where id=2; Update cars set top_mph=205 where id=3; Select * from cars;

Introduction to PHP and MySQL – Creating Database-Driven Websites MySQL commands: Delete from cars where id = 3; Alter table cars drop top_mph; Drop table cars; Drop database garage; Select * from cars;

Introduction to PHP and MySQL – Creating Database-Driven Websites Using PHPMyAdmin Create a new database BookShop Under Create New Table, enter Books Number of Fields = 6 First field: Field = Bkid, Type = INT, Index = Primary, A_I for Auto Increment.

Introduction to PHP and MySQL – Creating Database-Driven Websites Add records to your table: Field Type Lengths/Values Title VARCHAR 255 Author 60 Publisher Price DECIMAL 10, 2 Category 20

Introduction to PHP and MySQL – Creating Database-Driven Websites Other fields: Title Author Publisher Price Category Nightfall Asimov Bantam 5.99 Sci Fi Patriot Games Clancy Berkeley 4.95 Thriller 2010 Clarke Ballantine 3.95 Lie Down with Lions Follett Signet Mystery A Thief of Time Hillerman Harper The Fly on the Wall Hornet Flight 7.99 The Innocent Man Grisham Dell Mission of Honour

Using the MySQL Console Show all tables Use the Bookshop database Show all the tables Show the Books table structure Display all Books records Display all books within the category ‘Thriller’