-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.sql
More file actions
43 lines (32 loc) · 915 Bytes
/
users.sql
File metadata and controls
43 lines (32 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use message_board;
drop table if exists users;
create table users(
id int unsigned primary key auto_increment,
username char(20) unique ,
password char(30) not null,
token char(30) not null unique,
birthday date,
phone_number int unsigned unique ,
email char(30),
create_datetime datetime
default current_timestamp not null
);
desc users;
delete from users where token = 'bbc';
insert into users(username, password, token)
values('Jack', '123456', 'safesedese');
select * from users;
PREPARE createUser
FROM 'insert into users(
user_name, password, token)
VALUE (?, ?, ?)';
# set three variables for prepared statement.
SET @a = 'AAAA';
SET @b = '132131';
SET @c = 'bbc';
EXECUTE createUser USING @a, @b, @c;
DEALLOCATE PREPARE createUser;
PREPARE testMultipleStatement1
FROM 'insert into users(
user_name, password, token)
VALUE (?, ?, ?)';