01-16-2008, 02:45 AM
|
#4 (permalink)
|
|
The Reckoner
Join Date: Sep 2007
Posts: 437
Thanks: 22
|
You could use an AS to rename the columns so that the union treats them as the same column. Such as:
sql Code:
SELECT student_id AS id, FROM students WHERE student_id = '8563' AND password= MD5('password')
UNION
SELECT admin_id AS id, FROM admin WHERE admin_id = '8563' AND password= MD5('password')
__________________
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|