Damian Brasher wrote:
> CREATE DATABASE bab_register;
I always specify character set at this point. Always do
CREATE DATABASE foo DEFAULT CHARACTER SET utf8;
and you will hit fewer character set issues along the way. For PHP I think you
may have to do 'SET NAMES utf8;' after connecting.
In MySQL each column has its own character set and this is just a default, so if
you've already created the tables you need to drop and recreate them or use
CONVERT TABLE.
> forename VARCHAR(50) NOT NULL,
> surname VARCHAR(50) NOT NULL,
You probably don't need to split names up and doing so causes problems for some
people.
Please read
http://blog.mauveweb.co.uk/2008/01/25/tip-tables-containing-people/
> email VARCHAR(50),
As has been said, this is too short. Domains can theoretically be up to 253
characters long, but obviously humans are unlikely to choose e-mail addresses
anything like that long.
> member ENUM('yes','no') NOT NULL,
> new_attendee ENUM('yes','no') NOT NULL,
MySQL has had a BOOLEAN type for quite a while. It did not originally, which is
why you might have seen this kind of pattern in legacy applications and
documentation and even in MySQL's own permission tables. The boolean type is
simpler to process than enumerations particularly in SQL.
> CREATE TABLE macs (
> mac VARCHAR(50) NOT NULL,
A MAC address is not variable length and is not 50 characters long. It's 6 bytes
long, so if you want to store it in hexidecimal with : separators it's 17 bytes
hence
mac CHAR(17) NOT NULL;
Dan