Re: [Hampshire] [OT] BaB Soton Uni register MySQL script

Top Page

Reply to this message
Author: Damian Brasher
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] [OT] BaB Soton Uni register MySQL script
Victor Churchill wrote:

> Sorry to be a pain, but I see a problem if an attendee wants to
> register a second MAC. I'd be inclined to leave the MAC data out of
> the attendee table altogether. That's what the macs table is for.
>


Tidier and yes the PHP interface can bring the tables together into one form.

CREATE DATABASE bab_register;

USE bab_register;

DROP TABLE IF EXISTS attendee;
CREATE TABLE attendee (
        id              INT NOT NULL AUTO_INCREMENT,
        forename        VARCHAR(50) NOT NULL,
        surname         VARCHAR(50) NOT NULL,
        email           VARCHAR(50),
        member          ENUM('yes','no') NOT NULL,
        new_attendee    ENUM('yes','no') NOT NULL,
                        PRIMARY KEY (id),
) COMMENT "HLUG BaB meeting register Southampton Uni (ECS)";


DROP TABLE IF EXISTS macs;
CREATE TABLE macs (
        mac             VARCHAR(50) NOT NULL,
        id              INT NOT NULL,
                        PRIMARY KEY (mac),
                        FOREIGN KEY (id) REFERENCES attendee (id)
) COMMENT "MAC Address entries";



--
http://www.diap.org.uk - distributed backup volume management system.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.