Can't retrieve data properly from database in php -
i have 2 entries in tblstudentdetails having rollno = 0 , 1 whenever try retrieve data database first record i.e. rollno = 0 here code: <?php unset($_session['rollno']); unset($_session['studentname']); unset($_session['course']); include_once 'includes/dbconnection.php'; //echo $_post['txtrollno']; if ($_post['btnsubmit'] == 'submit') { if ($_post['txtrollno'] != '') { $query = "select studentname, course tblstudentdetails rollno = '$_post[txtrollno]'"; $result = mysql_query($query); $rowcount = mysql_num_rows($result); if ($rowcount == 0) { echo "you have entered incorrect roll no"; //header ('location: index.php'); } ...