MySQL Forums
Forum List  »  Newbie

Re: Need help executing
Posted by: Phillip Ward
Date: June 28, 2016 05:50AM

A few problems in there:

Lose the back-ticks anywhere and everywhere you can; you should never need them, so long as you avoid using reserved words as table or column names.

"User_Password" - NEVER store passwords in plain text.
Take the user-entered value, calculate a hash value from it and store and compare against that.

"int(196)" - makes no sense.
IIRC, the number here is the number of digits to show when displaying this column. If you're writing your application is, say, PHP, this width specification is completely ignored.

"User_Gender" - strangely, two values may not be enough. (https://en.wikipedia.org/wiki/ISO/IEC_5218)

"Active INT(1)" - again, "tinyint" would be a far better choice of Data Type.

You need to include a Primary Key (presumably on the Id column).

You may want to add some other indexes, to support other ways of querying this table.

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
June 27, 2016 09:56AM
June 27, 2016 10:22AM
Re: Need help executing
June 28, 2016 05:50AM
July 04, 2016 06:03AM
B M
July 08, 2016 01:36PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.