I am very new to sql i have a small doubt.I have a login form where user login[as obvious ] but login user is of two types one for travaller and one for others .I have different tables for travaller and other user containing user login user eg tbl_usrs have login information about travaller and table nm_camping_personal contains info about other users login info.So how can i write a sql query which select email and password from one table or email and password from other table for user to login. this is what i have tried
`$sql="SELECT username,password from `tbl_usrs` where (username='".$usr."' and password='".$pwd."') ` or SELECT email_id,password from `nm_camping_personal` where (email_id='".$usr."' and password='".sha1($pwd)."') "; `
but this seems not working.however
`$sql = "select * from tbl_usrs where username = '" . $usr . "' and password = '" .$pwd . "' ";
this works.So i have to write a query that travaller and other user can login Plz help
sorry for bad english
problem is very silly but need a help.I can i also have some very good reference for learning sql.