Answer the question
In order to leave comments, you need to log in
What to specify when creating a MYSQL table?
Hello. I would like to ask one question. I searched all over the Internet, but I did not find the necessary information.
I have 4 fields in the table:
1. id
2. username
3. email
4. password
And the question is, what values and types should be specified for these fields? I'm still a beginner, so I don't quite understand.
Answer the question
In order to leave comments, you need to log in
// здесь принимаем функции как параметры (yes - showOk, no - showCancel)
function ask(question, yes, no) {
// confirm(question) выполняется так как нам нужен результат из if (true или false)
// Если confirm(question) - true (нажмете Ок), то выполниться yes() (showOk), иначе выполниться no() (showCancel)
if (confirm(question)) yes()
else no();
}
function showOk() {
alert( "Вы согласились." );
}
function showCancel() {
alert( "Вы отменили выполнение." );
}
// здесь передаем функции showOk и showCancel в параметры ask (первый параметр - текст сообщения в confirm)
ask("Вы согласны?", showOk, showCancel);
In short - we have a function that takes three parameters - a message text and two callbacks.
The function shows a message with "yes" / "no" buttons (it depends on the browser, each formats the message in its own way, the text of the buttons and the location may also differ), and if the user clicks yes, it pulls the first callback, if it clicks no, it pulls the second callback.
And in the callbacks we pass two functions, each of which shows a message (different).
Nikita Kossman ,
1. id
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY
2. username
username VARCHAR(64)
3. email
email VARCHAR(129) UNIQUE NOT NULL
4.password
password VARCHAR(32)
You can use int for id, text for the rest. This is not the most super-optimal option, but it is not critical.
Or do you want exactly the table creation line?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question