title: warning trying to access array offset on value of type bool
body: <p>Can you help me please  i am doing android app using android studio by java language i also using php codes the code php codes was working fine suddenly i get this error warning trying to access array offset on value of type bool i don't why
  <strong>i am getting this issue warning trying to access array offset on value of type bool on line 48</strong>
  and here is the code 48 i am getting the error</p>
  <blockquote>
  <p>$query_params2 = array(</p>
  <pre><code>                        ':result_id'          =&gt; (int) $row1[&quot;result_id&quot;]
  </code></pre>
  </blockquote>
  <p>);</p>
  <pre><code>&lt;?php
  
      require(&quot;config.inc.php&quot;);
      
      $file_no         = $_POST['file_no'];
      
      $query = &quot;SELECT * FROM tb_exercises WHERE  file_no = :file_no ORDER BY exercise_id desc&quot;;
      $query_params = array(
  
              ':file_no'          =&gt; (int) $file_no
          );
      
  
      try
      {
          $stmt   = $db-&gt;prepare($query);
          $result = $stmt-&gt;execute($query_params);
          
          $rows = $stmt-&gt;fetchAll();
          if ($rows)
          {
              $response[&quot;success&quot;]    = true;
              $response[&quot;message&quot;]    = array();
      
              foreach ($rows as $row) 
              {
                  $query1 = &quot;SELECT * FROM tb_exercises_result WHERE  exercise_id = :exercise_id&quot;;
                  $query_params1 = array(
              
                          ':exercise_id'          =&gt; (int) $row[&quot;exercise_id&quot;]
                      );
                  $stmt1   = $db-&gt;prepare($query1);
                  $result1 = $stmt1-&gt;execute($query_params1);
                  
                  $row1 = $stmt1-&gt;fetch();
                  if ($row1)
                  {
                      $messege[&quot;has_result&quot;]   =  1;
                  }
                  else
                  {
                      $messege[&quot;has_result&quot;]   =  0;
                  }
                  
                  $query2 = &quot;SELECT * FROM tb_reviews WHERE   result_id = :result_id&quot;;
                  $query_params2 = array(
              
                          ':result_id'          =&gt; (int) $row1[&quot;result_id&quot;]
                      );
                  $stmt2   = $db-&gt;prepare($query2);
                  $result2 = $stmt2-&gt;execute($query_params2);
                  
                  $row2 = $stmt2-&gt;fetch();
                  if ($row2)
                  {
                      $messege[&quot;review_id&quot;]    =  (int) $row2[&quot;review_id&quot;];
                  }
                  else
                  {
                      $messege[&quot;review_id&quot;]   =  0;
                  }
                  
                  $messege[&quot;id&quot;]               = (int) $row[&quot;exercise_id&quot;];
                  $messege[&quot;url&quot;]              =       $row[&quot;url&quot;];
                  $messege[&quot;thumb&quot;]            =       $row[&quot;thumb&quot;];
                  $messege[&quot;text_exercise&quot;]    =       $row[&quot;text_exercise&quot;];
                  $messege[&quot;type&quot;]             = (int) $row[&quot;type&quot;];
                  $messege[&quot;date_s&quot;]           =       $row[&quot;date_now&quot;];
              
              
                  array_push($response[&quot;message&quot;], $messege);
              }
      
              $response[&quot;success&quot;] = true;
              echo json_encode($response);
          }
          else
          {
              $response[&quot;success&quot;] = false;
              die(json_encode($response));
          }
      }
      catch (PDOException $ex)
      {
          $response[&quot;success&quot;] = false;
          $response[&quot;message&quot;] = $ex;
          die(json_encode($response));
      }
  
      
      
  
  ?&gt;
  </code></pre>