I am working on a table for a registration form. Among it's fields/columns are:
student_no (primary key) and age
The student_no would hold values that have a fixed length of 9 characters that contain 8 numbers and a dash, for instance 11-423685, 12-537859, 12-974156
I'm not sure whether to use char or varchar because I wanted to know more about the two types before using them. specifically:
Can one or both of these types hold values that include various symbols on the keyboard (-, @, _, $, #, etc.), like how I need the student number to contain a dash?
If I give char a length of 9 would it be invalid to give it a value of length 8 and below
Other important differences to note, if any
as for the age, do i need to specify a length if I use tinyint? or should i just leave the length field in phpMyAdmin blank?
note : this is actually just a school exercise where the instruction was to make a working registration form with any fourteen fields, so I decided to not use a birthday for now to avoid having to use dates.
`, and `` are empty elements, so they don't need an end tag, or a `/`; just write them as I wrote them here. The doctype you should use is ` `. – Šime Vidas Dec 16 '12 at 16:05