hi,im using registration form for registering users to the new account.i have 2 tables in one database.database name is test and table name is student and member.in student table which contain the register no of student which is already stored in the database.in member table,it has 4 fields which is name,register no,address,email id.when a student registered,the register no of student should be same as the registerno in the student table which is already exist.
i had tried to overcome this problem.but didnt get the proper answer for this..
Any help would be appreciated.
thank you
this is my php page
<html>
<body>
<html>
<head>
<body>
<?php
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$regno = $_POST['regno'];
$dept = $_POST['dept'];
$valid = $_POST['valid'];
$dob = $_POST['dob'];
$address = $_POST['address'];
$emailid = $_POST['emailid'];
$con = mysql_connect("localhost");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$sql="INSERT INTO member (fname,lname,regno,dept,valid,dob,address,emailid) VALUES('$fname','$lname','$regno','$dept','$valid','$dob','$address','$emailid')";
mysql_query($sql) or die(mysql_error());
$result="SELECT student.regno, member.regno if(member.regno=student.regno,"register");"
or die(mysql_error());
mysql_close($con)
?>
<a href="library.html" target="_parent">home</a>
</body>
</html>