Guest User

Untitled

a guest
Jan 26th, 2018
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. create table `a_users` (
  2. `id` int unsigned NOT NULL AUTO_INCREMENT,
  3. `user` varchar(32) NOT NULL,
  4. `pass` varchar(32) NOT NULL,
  5. PRIMARY KEY (`id`)
  6. );
  7. create table `b_users` (
  8. `id` int unsigned NOT NULL AUTO_INCREMENT,
  9. `user` varchar(32) NOT NULL,
  10. `pass` varchar(32) NOT NULL,
  11. PRIMARY KEY (`id`)
  12. );
  13. create table `c_users` (
  14. `id` int unsigned NOT NULL AUTO_INCREMENT,
  15. `user` varchar(32) NOT NULL,
  16. `pass` varchar(32) NOT NULL,
  17. PRIMARY KEY (`id`)
  18. );
  19.  
  20.  
  21. insert into a_users values (0,'nathan','password');
  22. insert into b_users values (0,'nathan','password1');
  23. insert into c_users values (0,'nathan','password');
  24.  
  25.  
  26.  
  27. mysql> select * from a_users where user='nathan' and pass='password';
  28. +----+--------+----------+
  29. | id | user | pass |
  30. +----+--------+----------+
  31. | 1 | nathan | password |
  32. +----+--------+----------+
  33. 1 row in set (0.06 sec)
  34.  
  35. mysql> select * from a_users where user='nathan' and pass='password' UNION
  36. -> select * from b_users where user='nathan' and pass='password' UNION
  37. -> select * from c_users where user='nathan' and pass='password';
  38. +----+--------+----------+
  39. | id | user | pass |
  40. +----+--------+----------+
  41. | 1 | nathan | password |
  42. +----+--------+----------+
  43. 1 row in set (0.00 sec)
  44.  
  45. mysql> select * from a_users where user='nathan' and pass='password1' UNION
  46. -> select * from b_users where user='nathan' and pass='password1' UNION
  47. -> select * from c_users where user='nathan' and pass='password1';
  48. +----+--------+-----------+
  49. | id | user | pass |
  50. +----+--------+-----------+
  51. | 1 | nathan | password1 |
  52. +----+--------+-----------+
  53. 1 row in set (0.00 sec)
Add Comment
Please, Sign In to add comment