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



$query="SELECT * FROM student_info where student_info.admission_no='$admission_no'";

$query2="SELECT class_id FROM student_class where admission_no='$admission_no'
         AND year='$year'";


$query3="SELECT class_name,grade_id,stream FROM class where class_id='$class_id'";

$query="select amount_id from payment where admission_no='$admission_no'";
$result=mysql_query($query);while($row = mysql_fetch_array($result)){ **            **// line 250

$query="select payment_value from payment_amount  where amount_id='$amount_id' and date like '$year-%'";
        while($row = mysql_fetch_array($result)){



This might be wrong, I haven't ran it.. But, if this is all in the same .php file, then surely you've already defined $result above? So when you do this:

$query="select amount_id from payment where admission_no='$admission_no'";
while($row = mysql_fetch_array($result)){ ** **// line 250

Maybe that is what is triggering it.

This is telling you that the variable in your query is empty. Try echoing out the query to make sure it is as expected and then run what is echo'd out directly in phpMyAdmin to see if you get any errors there as well.

$query="select amount_id from payment where admission_no='$admission_no'";
echo $query;

I tried echoing and it generates result. The query was not empty. It says,

" select amount_id from payment where admission_no='2012/2' ".

And have you run this in phpmyadmin to see what result or error you get directly from the query in the database?

I would double check that $admission_no has a value assigned to it. The rest of the query seems to be fine.