mysqli_query和while循环[重复]的PHP语法错误

This question already has an answer here:

Please help me out what I am doing wrong in this block of code/script:

 $product=array();
 if($result=mysqli_query($con,"SELECT * FROM `INS_PAN`")
 {
     while($object==mysqli_fetch_object($result)):
         $product[]=$object;
     endwhile;
     mysqli_free_result($result);
 }

Please correct me out, I am Rookie in PHP.

</div>

you have an error in this line if($result=mysqli_query($con,"SELECT * FROM INS_PAN"). you have missing ) close brackets. and also = equal sign errors in

replace above line with this:

$result=mysqli_query($con,"SELECT * FROM `INS_PAN`");
    if($result){
       //your code
    }

Some Suggestion: The best practices to avoid brackets error. when you open brackets ( or { then you should immediately closed the brackets before any code or statement.