OK, this is really just an exercise for me to familiarize myself with how this all works and setting things up properly. So I'm making a guest book. I wasn't sure what the difference was between char, varchar, and the different text types. I kept getting errors when I was created fields using the text types, so I switched them to char. Maybe that's because I was trying to define the max length of the field? The documentation isn't all that great.
Anyway, I've also read several things that say don't store the password in database. I want the users to be able to change their own entries, but only read other entries (with the exception of e-mail addresses). Basically the same as this forum works.
Also, to contect to the database, I have to put my master password for my web hosting account. What's to stop someone from figuring out my password and having at it with my account? The password will need to be in the connection string to the database. What is it that I'm not understanding here?
Here's how I set up the table sans password. Is this how it should be?
Database guestbook - table Guests running on localhost
table Guests has been altered.
Field Type Attributes Null Default Extra Action
GuestID bigint(20) No auto_increment Change Drop Primary Index Unique Fulltext
FirstName varchar(15) No Change Drop Primary Index Unique Fulltext
LastName varchar(15) No Change Drop Primary Index Unique Fulltext
MiddleInitial char(1) No Change Drop Primary Index Unique Fulltext
UserName varchar(15) No Change Drop Primary Index Unique Fulltext
EMail varchar(125) No Change Drop Primary Index Unique Fulltext
Date date No 0000-00-00 Change Drop Primary Index Unique Fulltext
Comments longtext No Change Drop Primary Index Unique Fulltext
With selected: Or
Indexes : [Documentation]
Keyname Type Cardinality Action Field
PRIMARY PRIMARY 1 Drop Edit GuestID
GuestID UNIQUE 1 Drop Edit GuestID




Reply With Quote