Difference between revisions of "SQL with PHP"

From SQLZOO
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 5: Line 5:


==Setting up a server from Amazon==
==Setting up a server from Amazon==
*Choose a server and fire it up
*Choose an image and launch it
{{#ev:youtube|GwGKUMvZBTM}}
{{#ev:youtube|GwGKUMvZBTM}}
*Connect to your server with putty
*Connect to your server with putty
**Convert pem to ppk with puttygen
**Convert pem to ppk with puttygen
**Connect with putty
{{#ev:youtube|G_Y-dfATSEs}}
{{#ev:youtube|G_Y-dfATSEs}}
**Connect with putty
*Install apache, mysql and php
*Install apache, mysql and php
**Check each of these is running
**Check each of these is running
{{#ev:youtube|}}
{{#ev:youtube|vdN8E3q5t0I}}


==Exploring the movie database==
==Exploring the movie database==
*Download and install the database, set up users
*Download and install the database http://sqlzoo.net/moviesm.sql and set up a user
*Examine the tables
*Examine the tables
*Some queries on movie, actor and casting
*Some queries on movie, actor and casting
{{#ev:youtube|ObsGiXJ_7wU}}


==PHP==
==PHP==
Line 24: Line 25:
**Calculations
**Calculations
**Debugging
**Debugging
{{#ev:youtube|EPPBdf0TybM}}
*Connect to a database and run a simple query
*Connect to a database and run a simple query
*Connect to a database and get a list of results
{{#ev:youtube|3TVBuE_pp-g}}
*Use a JOIN to get the director, show an image
{{#ev:youtube|9os4TYzWW7w}}
*Parameterise the page
{{#ev:youtube|Fu4hsq3EXXA}}
*Protect from SQL injection
{{#ev:youtube|znzvEBDeyhI}}
*Create the actor page
*Create the actor page
*Create the movie page
*Create the movie page
*Creating links
*Creating links

Latest revision as of 15:58, 28 October 2016

PHP and MySQL at the Movies

This tutorial takes you through building a web site to show details of Movies held in a database.

School of computing students at Edinburgh Napier University can complete this tutorial using the server socwebtech1.napier.ac.uk other students will need access to a server set up the database first.

Setting up a server from Amazon

  • Choose an image and launch it
  • Connect to your server with putty
    • Convert pem to ppk with puttygen
    • Connect with putty
  • Install apache, mysql and php
    • Check each of these is running

Exploring the movie database

PHP

  • Hello world with php
    • Calculations
    • Debugging
  • Connect to a database and run a simple query
  • Use a JOIN to get the director, show an image
  • Parameterise the page
  • Protect from SQL injection
  • Create the actor page
  • Create the movie page
  • Creating links