Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table `a_users` (
- `id` int unsigned NOT NULL AUTO_INCREMENT,
- `user` varchar(32) NOT NULL,
- `pass` varchar(32) NOT NULL,
- PRIMARY KEY (`id`)
- );
- create table `b_users` (
- `id` int unsigned NOT NULL AUTO_INCREMENT,
- `user` varchar(32) NOT NULL,
- `pass` varchar(32) NOT NULL,
- PRIMARY KEY (`id`)
- );
- create table `c_users` (
- `id` int unsigned NOT NULL AUTO_INCREMENT,
- `user` varchar(32) NOT NULL,
- `pass` varchar(32) NOT NULL,
- PRIMARY KEY (`id`)
- );
- insert into a_users values (0,'nathan','password');
- insert into b_users values (0,'nathan','password1');
- insert into c_users values (0,'nathan','password');
- mysql> select * from a_users where user='nathan' and pass='password';
- +----+--------+----------+
- | id | user | pass |
- +----+--------+----------+
- | 1 | nathan | password |
- +----+--------+----------+
- 1 row in set (0.06 sec)
- mysql> select * from a_users where user='nathan' and pass='password' UNION
- -> select * from b_users where user='nathan' and pass='password' UNION
- -> select * from c_users where user='nathan' and pass='password';
- +----+--------+----------+
- | id | user | pass |
- +----+--------+----------+
- | 1 | nathan | password |
- +----+--------+----------+
- 1 row in set (0.00 sec)
- mysql> select * from a_users where user='nathan' and pass='password1' UNION
- -> select * from b_users where user='nathan' and pass='password1' UNION
- -> select * from c_users where user='nathan' and pass='password1';
- +----+--------+-----------+
- | id | user | pass |
- +----+--------+-----------+
- | 1 | nathan | password1 |
- +----+--------+-----------+
- 1 row in set (0.00 sec)
Add Comment
Please, Sign In to add comment