I want to retrieve records in my database in order to manage details. The below error message displayed when i trying to do that. Can anyone help me out?
( ! ) Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\Student registration\manage student details\manageStudentDetailsForm.php on line 250
<?php
$class_id='0';
$amount_id='0';
$query="SELECT * FROM student_info where student_info.admission_no='$admission_no'";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)){
$s_id=$row['st_id'];
$first=$row['admission_no'];
$sec=$row['admission_date'];
$third=$row['full_name'];
$forth=$row['name_with_initial'];
$fifth=$row['date_of_birth'];
$sixth=$row['religion'];
//$seven=$row['gender'];
$eight=$row['address'];
$nine=$row['telephone_no'];
$ten=$row['grade_on_admission'];
$leven=$row['password'];
$twoel=$row['st_house'];
$description_about_st=$row['description_about_st'];
}
$query2="SELECT class_id FROM student_class where admission_no='$admission_no'
AND year='$year'";
$result2=mysql_query($query2);
while($row2=mysql_fetch_array($result2)){
$class_id=$row2['class_id'];
}
$query3="SELECT class_name,grade_id,stream FROM class where class_id='$class_id'";
$result3=mysql_query($query3);
while($row3=mysql_fetch_array($result3)){
$class_name=$row3['class_name'];
$grade_id=$row3['grade_id'];
$stream=$row3['stream'];
}
$query="select amount_id from payment where admission_no='$admission_no'";
$result=mysql_query($query);while($row = mysql_fetch_array($result)){ ** **// line 250
$amount_id=$row['amount_id'];
}
$query="select payment_value from payment_amount where amount_id='$amount_id' and date like '$year-%'";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)){
$payment_value=$row['payment_value'];
}
?>