I have another problem...
I have a field in a form called "staff_id". No matter what this number is, it MUST be 4 digits.
Ie. "1" must be "001" and "23" will be "023".
how do I tell mysql to do this?
thanks Ben
Sorry.
I meant MUST BE 3 DIGITS!
thanks ben
Use field type: tinyint unsigned zerofill
tinyint is only 0-255 when unsigned though. zerofill would fill out the other request.
Why do you need the leading zeros in the database?
I need them so that all pilots have a three digit staff number.
Cheers Ben
So you only need it for printing purposes, then don't store the extra zeros in the database, but print them when you need them:
$iNumber = 2; printf("%03d", $iNumber);