guys i need some help!.. my friends are having their project on web developing??

How can i create a Login System with this database??

tbl_stud
st_uname = logmein
st_pw = 123
type_id = student

tbl_prof
pr_uname = pro
pr_pw = 321
type_id = prof

tbl_admin
ad_uname = adm
ad_pw = 890
type_id = admin

tbl_Utype
type_id = admin,prof,student
type_num = 1,2,3

i really need some help on how to create login system on their web site with that database..

what query should i need to put??

please?? need some help..

hope you can modify from below code, by type...

//take student table
$student = $_POST;
$password = $_POST;
$type = $_POST;

//connect to db
$connection = mysql_connect("$localhost", "root", "");

//check connection
if(!$connection)
echo die(mysql_error());
else
echo "Connected";

//select database
mysql_select_db("my_db", "$connection");

//query
$sql_login = mysql_query(SELECT * FROM tbl_stud where username = $username and password = $password);

//check either the username is existed or not
//equal to 1 if existed (true)
//successful
$count = mysql_num_rows($result);
if($count == 1)
{
session_register("$username");
session_register("$password");
header("location: welcome.html");
}
else //failed
{
header("location: login.html");
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.