Re: Types of table....
| From: | James, Yz | Date: | Tue, 31 Jul 2001 22:44:55 +0000 |
| Subject: | Re: Types of table.... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60522@lists.php.net to get a copy of this message | ||
Hello Steve,
well, you should have the table set, at the very least, something like this:
UserId - INT, Primary Key, Auto increment
RealFName - varchar(20)
RealLName
UserName - Varchar (20)
PassWord - Varchar (12)
The length of the fields is optional, and you should perform checks on the
username and password to confirm that they don't contain irregular
characters that might give you problems in the future.
I'd do something like this (on signup):
if (!preg_match("/^[[:alnum:]_]+$/", $username)) {
//error
}
-That'd check if the username contained alphanumeric characters and the
underscore ("_") character. I'd take out the underscore for the password.
Having the first and last name in separate columns will allow you to perform
more informal greets to the user when you use this - Hello $RealFName, how
are you?
Look up column types in the MySQL manual at mysql.com for more detailed info
;)
James.
"Steve Wright" <steve@stevewrightonline.co.uk> wrote in message
news:00a001c11a07$0d743f60$0615fea9@COM...
HEy,
I am still a newbie, and have no idea how to use phpMyAdmin yet, and don't
really know much about MySQL databases and setting up tables.
My Question: What table type should i use for a users REAL NAME,
USERNAME, PASSWORD, how long should i set these to, and should i have
anything else clicked while in the process??
Thanks..
Steve