PDA

View Full Version : Phpmyadmin



ljmyers
09-01-2004, 09:06 AM
I am beginning to learn about php and mysql. I have found a tutorial on building a member log in system. Not that members have to log in to use the site, but only if they choose to. I want to learn how a database and php/mysql work and I thought this would be a good way to start since it has all of different components. I have created the database for it in direct admin but when I choose the database it wants me to create a table. No biggie except that it wants an area filled in called "fields". This one little thing has stumped me. :)

eg.
Create new table on database ljmyers?magmembers :
Name : users
Fields : ???

I can't find any info on "fields" to direct me as to how, what or why to enter into this area. Can you guys help me?

Thanks Bunches,
Lana

dbmasters
09-01-2004, 09:12 AM
it depends on your table needs, enter the number of fields you want your table to have. You have one field for every piece of data you want to store.

AN example would be:

ID INT(10) auto_increment primary key,
name nvarchar2(100),
username nvarchar2(100),
password nvarchar2(32)

So it would have 4 fields, so enter 4 in that text box.

ljmyers
09-01-2004, 09:46 AM
Well , that would make sense. :) Thanks Dan.

dbmasters
09-01-2004, 09:51 AM
oh, and ignore the "nvarchar2" in MySQL it would just be "varchar" "nvarchar2" is a datatype from Oracle which I typed by mistake...force of habit.

Also, when saving passwords, just a little friendly advice, it nice run the password they enter thru MD5() with either php or MySQL or SHA1() in php just to encrypt it which keeps it private even from you, the dba...