Ошибка mysql_fetch_array() ожидает, что параметр 1 будет ресурсом, логическим значением, заданным в C:\xampp\htdocs\school\admin\view-assstudent-PHP на линии 114
Я новичок в кодировании php и не знаю, почему получаю эту ошибку
mysql_fetch_array() ожидает, что параметр 1 будет ресурсом, логическим значением, заданным в c:\xampp\htdocs\school\admin\view-assstudent-php на линии 114
Что я уже пробовал:
<?php include('connection.php'); session_start(); $fname=$_SESSION['fname']; if(''!=$_SESSION['admin']){ ?> <?php include('connection.php'); if(@$_POST[btn]=="Save") { mysql_query("INSERT INTO 'student_info' set `class` = '$_POST[class]' , `name` = '$_POST[name]', `roll` = '$_POST[roll]', `age` = '$_POST[age]', `email` = '$_POST[email]', `father_name` = '$_POST[father_name]', `mother_name` = '$_POST[mother_name]', `gender` = '$_POST[gender]', `contact_no1` = '$_POST[contact_no1]', `dob` ='$_POST[dob]', `password` = '$_POST[password]' , `contact_no2` = '$_POST[contact_no2]', `guardian_email` = '$_POST[guardian_email]', `address` = '$_POST[address]' "); /*mysql_query("INSERT INTO `student_info`(`class`, `name`, `roll`, `age`, `email`, `father_name`, `mother_name`, `gender`, `contact_no1`, `dob`, `password`, `contact_no2`, `guardian_email`, `address`) VALUES ('$_POST[class]','$_POST[name]','$_POST[roll]','$_POST[age]','$_POST[email]','$_POST[father_name]','$_POST[mother_name]','$_POST[gender]','$_POST[contact_no1]','$_POST[dob]','$_POST[password]','$_POST[contact_no2]','$_POST[guardian_email]','$_POST[address]') "); */ } ?>
<!DOCTYPE html> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title> <?php require '../school_name.php'; ?> <!-- Bootstrap Core CSS --> <!-- Custom CSS --> <!-- Custom Fonts --> <!-- .style1 { font-size: 16px; font-weight: bold; } --> <div id="wrapper"> <!-- Navigation --> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <span class="sr-only"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <a class="navbar-brand"> <?php require '../school_name.php'; ?> </a> </div> <!-- Top Menu Items --> <ul class="nav navbar-right top-nav"> <li class="dropdown"> <a href="#" class="dropdown-toggle"> <?php echo $fname; ?></a> <ul class="dropdown-menu"> <li> <a href="myprofile.php"> Profile</a> </li> <!-- <li> <a href="#"> Settings</a> </li> --> <li class="divider"></li> <li> <a href="logout.php"> Log Out</a> </li> </ul> </li> </ul> <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens --> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav side-nav" style="height: 600px"> <?php require 'side_nav.php'; ?> </ul> </div> <!-- /.navbar-collapse --> <div id="page-wrapper"> <div class="container-fluid"> <!-- Page Heading --> <div class="row"> <div class="col-lg-12"> <h3 align="center" class="page-header alert alert-info "> Registration Form </h3> <!----------------------------------------------- ----------------Form Begins Here----------------- -------------------------------------------------> <table class="table table-striped table-bordered table-hover"><tbody><tr> <td height="52" colspan="2"><span class="style1">Candidate Information</span></td> </tr><tr> <td width="160"> Select Class : </td> <td width="482"> <?php include("connection.php"); $result3 = mysql_query("SELECT batch FROM year order by batch desc");?> Class 1 Class 2 Class 3 Class 4 Class 5 Class 6 Class 7 Class 8 </td></tr><tr> <td height="52"> Student Name : </td><td></td></tr><tr><td height="49"> Roll Number: </td><td> </td></tr><tr><td height="50"> Date of Birth:</td> <td></td></tr><tr><td height="46">Age: </td><td></td></tr><tr><td height="42">Gender:</td><td>Select oneMaleFemale</td></tr><tr><td height="49">Contact Number: </td><td></td></tr><tr><td height="49">Email: </td><td></td></tr><tr> <td height="49"> Password: </td><td></td></tr><tr><td height="52" colspan="2"><span class="style1">Personal Information</span></td></tr><tr><td height="46">Fathers name: </td><td></td></tr><tr><td height="44">Mothers name:</td><td></td></tr><tr><td height="49">Contact Number (Guardian): </td><td></td></tr><tr><td height="49">Guardian Email: </td><td></td></tr><tr><td height="104">Present Address:</td><td></td></tr><tr> <td height="72"> </td> <td> </td></tr></tbody></table> <br><br><br> </div> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </div> <!-- jQuery --> <!-- Bootstrap Core JavaScript --> <?php }else{ header("location:index.php"); } ?></div>