Hi i am facing problem in validating from a particular table named userdetails.
All the tables used in this code are working fine.
Only validation done with the data of userdetails isnot working the validation with streams and course table is working fine.
Please help me where i am going wrong i can't find any thing .
The code is below .
$uname=$_POST['username'];
$pass=$_POST['pass'];
$cpass=$_POST['cpass'];
$e_mail=$_POST['email'];
$rollno=$_POST['wbutrollno'];
$regisno=$_POST['wbutregisno'];
$idcard=$_POST['nsecidcard'];
$details="SELECT * FROM userdetails";
$details=mysql_query($details);
$rowdetails=mysql_fetch_array($details);
$sqlstream="SELECT stream_type FROM streams WHERE stream_code='".$_REQUEST['stream']."'";
$qrystream=mysql_query($sqlstream);
$rowstream=mysql_fetch_array($qrystream);
$sqlcourse="SELECT course_code FROM course WHERE course_code='".$_REQUEST['course']."'";
$qrycourse=mysql_query($sqlcourse);
$rowcourse=mysql_fetch_array($qrycourse);
if($regisno==$rowdetails['wbutregisno'] || $rollno==$rowdetails['wbutrollno'])
{
$GLOBALS['err_msg1']="YOU ARE ALREADY REGISTERED. PLEASE LOGIN WITH YOUR USERNAME & PASSWORD";
regis_unsucc();
exit();
}
elseif($uname==$rowdetails['username'])
{
$GLOBALS['errusername']="USERNAME already exists , try another USERNAME.";
main();
exit();
}
elseif($e_mail==$rowdetails['email'])
{
$GLOBALS['erremail']="e-MAIL ID already exists , try another e-MAIL ID.";
main();
exit();
}
elseif($rowstream['stream_type']!=$rowcourse['course_code'])
{
$GLOBALS['errcourse']="Please select COURSE & STREAM properly.";
main();
exit();
}
else register();