Jump to content

SQL problem


heshan

Recommended Posts

Hi guys,

 

When evaluating the below SQL query following error appears. Can anyone will give me a solution for this?

 

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\search student information\veiwSerachResultByAdmission.php on line 131

 

<?php

	$class_id='0';
	$payment='0';
		  
	$query="select * from student_info where admission_no='$admission_no'";
	$result=mysql_query($query);
	while($row = mysql_fetch_array($result)){

           $Admission_Number=$row['admission_no'];
   $Admission_Date=$row['admission_date'];
   $Student_Full_Name=$row['full_name'];
   $Student_Name_With_Initials=$row['name_with_initial'];
   $Date_of_Birt=$row['date_of_birth'];
   $Religion=$row['religion'];
   //$Gender=$row['gender'];
   $Address=$row['address'];
   $Telephone_Number=$row['telephone_no'];
   $Grade_on_Admission=$row['grade_on_admission'];
   $Password=$row['password'];
   $st_house=$row['st_house'];
   $Student_description=$row['description_about_st'];
	  }
	  
	  //check class id
	  
	$query1="select class_id from student_class where admission_no='$admission_no' and year='$year'";
	$result1=mysql_query($query1);
    while($row1=mysql_fetch_array($result1)){
        $class_id=$row1['class_id']; }
	  	  
	 $query="select grade_id,class_name,stream from class where class_id='$class_id'";
	 $result=mysql_query($query);
	  while($row = mysql_fetch_array($result)){
		  $Present_Grade=$row['grade_id'];
		  $Present_Class=$row['class_name'];
		  $present_stream=$row['stream'];
		  			 }


	  		 

$query2="select payment_value from payment_amount inner join payment on payment_amount.amount_id=payment.amount_id where          payment.admission_no='$admission_no' and payment_amount.date like '$year-%'";
	 $result2=mysql_query($query2);
	  while($row2= mysql_fetch_array($result2)){
	  $payment=$row2['payment_value'];
	  }

			  
	?>

Link to comment
https://forums.phpfreaks.com/topic/266740-sql-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.