Download presentation
Presentation is loading. Please wait.
Published byGriffin Copeland Modified over 9 years ago
1
THE WEBMASTERS: SENG + WAVERING
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);
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.