Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- register->
- insert into users (name, surname, username, password, email, birthday) values ('Test', 'User', 'test_user', '123456', 'test@user.com', '01.01.1980');
- login->
- select u.* from users u where
- ( u.username = username_pattern or u.email = email_pattern ) and
- (u.password = password_pattern);
- topics for category ->
- select t.* from topics t, topics_categories tc, categories c where
- t.id = tc.topic_id and
- tc.category_id = c.id;
- last 10 topics ->
- select * from (
- select * from topics
- order by created_at desc limit 10
- ) order by created_at ASC;
- show topic->
- select t.*, c.* form topics t, comments c where
- t.id = requested_topic_id and
- c.topic_id = t.id;
- admin panel=> search users bt name, surname or email ->
- select u.* from users u where
- u.username like pattern or
- u.name like pattern or
- u.surname like pattern;
- admin panel=> all users with the requested role ->
- select u.* from users u, roles r where
- r.id = requested_role_id and
- u.role_id = r.id;
- create topic->
- insert into topics (title, content, tags, status) VALUES ('Topic One', 'Content of the first topic', 'tag1, tag2', true);
- create comment->
- insert into comments (content, topic_id, category_id) VALUES ('This is comment's content', 1, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement