Presentation is loading. Please wait.

Presentation is loading. Please wait.

THE WEBMASTERS: SENG + WAVERING.  On account of construction, we will be having class in room 1248 next week.

Similar presentations


Presentation on theme: "THE WEBMASTERS: SENG + WAVERING.  On account of construction, we will be having class in room 1248 next week."— Presentation transcript:

1 THE WEBMASTERS: SENG + WAVERING

2

3  On account of construction, we will be having class in room 1248 next week.

4  We have used variables to store information for our websites to use. How do we store information for websites to use even when people close their browsers and sign off?

5  Databases!  Allow for persistent storage of data

6  Databases are a way to store information without relying on Javascript or PHP variables.  A database is a table of objects – like an spreadsheet.  Columns define attributes of an object  Each row is a separate object

7  SQL – Structured Query Language  A way of talking to a database which lets us implement CRUD  CRUD – the four basic functions of persistent storage: Create, Retrieve, Update Delete

8  Combine basic commands and elements to form clauses  Clauses combine to form statements  Use phpMyAdmin to work with databases  http://demo.phpmyadmin.net/trunk-config/ http://demo.phpmyadmin.net/trunk-config/

9  CREATE DATABASE Webship  USE Webship  CREATE TABLE students  Define columns  SELECT * FROM  Many other commands!

10  We will still use Javascript and PHP variables – need some way to take information from database and use it to create a webpage.

11  Can send SQL queries to database with PHP  mysql_connect(localhost,$username,$passw ord);  @mysql_select_db($database) or die( "Unable to select database");  Can assign PHP variables as the results returned from MySQL queries  $variable = mysql_query("SELECT * FROM example")

12  $query = "INSERT INTO students VALUES (’Albert',’albert.wavering@gmail.com’);  mysql_query($query);


Download ppt "THE WEBMASTERS: SENG + WAVERING.  On account of construction, we will be having class in room 1248 next week."

Similar presentations


Ads by Google