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

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

st_uname = logmein
st_pw = 123
type_id = student

pr_uname = pro
pr_pw = 321
type_id = prof

ad_uname = adm
ad_pw = 890
type_id = admin

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..

Create login form for using via web page (can be both HTML and PHP). Pass the data from that form to the login script and check if the user input data are already exists in the database, i.e., the username and password does not match or not.

You can learn many tutorials of login/out system on the internet. Google yourself.

Connect the database useing mysql_connect(), select the database using mysql_select_db(), query the database with the username and password entered by user
EG: mysql_query("SELECT * FROM `tbl_stud` WHERE `st_uname` = '$username' AND `st_pw` = '$password'"); where $username and $password is data collected from login fields username and password respectively.. get the count of record from db with mysql_num_rows() if it is 0 it means no existing user. if it is 1 or > 1 that means user existed in the db

if you have any query ask here ! hope it will helps you ! happy developing

Trying this simple login form

//db connection
$nameserv = "localhost";
$username = "root";
$pass = "";
$dbname = "daniweb";
$conn = mysql_connect($nameserv,$username,$pass)or die(mysql_error());
$selectdb = mysql_select_db($dbname, $conn);

$login = $_POST['login'];
	$usrname = $_POST['username'];
	$password = $_POST['password'];
	$upass	= MD5($password);
	//validate input
		$msg = "Empty Username!<br />";
		$a = 1;
		$msg .= "Empty Password!<br />";
		$a = 1;
	if($a != 1){
		$sql = "SELECT *FROM login WHERE username = '".$usrname."' AND password = '".$upass."'";
		$exec = mysql_query ($sql, $conn);
		$count = mysql_num_rows($exec);
		$data_login = mysql_fetch_array($exec);
		echo mysql_error();
		if($count == 0){
			$msg .= "Login failed!";
			session_register ($usrname);
			$_SESSION['user'] = $usrname;
			$msg .= "<span style='color : #0000FF'>Login Success!</span>";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<title>Login Form</title>
<h2>Login Form Example</h2>
<div style="margin : 10px; font-style : italic; color : #FF0000"><?php echo $msg;?></div>
<form method="POST" action="<?php $_SERVER['PHP_SELF'];?>">
		<td><input type="text" name="username" value="<?php echo $usrname;?>" /></td>
		<td><input type="password" name="password" /></td>
		<input type="submit" name="login" class="button" value="Login" />

or download the complete source code and its database in