View Single Post
Old 01-16-2008, 02:20 AM   #2 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

You could always go for a UNION approach:

sql Code:
SELECT  username, password
FROM    students
WHERE   student_id = '8563'
AND password = MD5('password')
UNION
SELECT  username, password
FROM    admin
WHERE   admin_id = '8563'
AND password = MD5('password')

However, I would be keen to suggest that your table structure is... not wrong, but not well thought out. I think what would have been a better approach would to have put every single individual in one table, and then use bitwise operators to ascertain (to determine) their levels.

Welcome to TalkPHP by the way I hope you decide to become a regular around here!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote