SQL with PHP

Jump to: navigation, search

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



  • 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