title: how to fix this error "Trying to access array offset on value of type null"
body: <p>the message:
  Trying to access array offset on value of type null in C:\xampp\htdocs\simple\individu_keputusan.php on line 48</p>
  <p>my coding:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>$papar=mysqli_query($con,"SELECT* FROM peserta
  WHERE idpeserta='$PESERTA'");
  $info1=mysqli_fetch_array($papar);
  #PANGGIL REKOD PEMENANG IKUT ID PESERTA
  $WINNER=mysqli_query($con,"SELECT *
  FROM pemenang WHERE idpeserta='$PESERTA'");
  $win=mysqli_fetch_array ($WINNER); 
  
  #if($win==NULL){
  echo "&lt;script&gt;alert('Dukacita dimaklumkan anda tidak 
  memenangi pertandingan ini');
  window.location='dashboard.php'&lt;/script&gt;";
  }
  ?&gt;
  &lt;html&gt;
  &lt;center&gt;
  &lt;div&gt;&lt;h2&gt;DASHBOARD PESERTA&lt;/h2&gt;&lt;/div&gt;
  &lt;table width="80%" border=0 align="center"&gt;
  &lt;tr&gt;
  &lt;td colspan="5" valign="middle" align="right"&gt;&lt;b&gt;
  &lt;a href="dashboard.php"&gt;HOME&lt;/a&gt; |
  &lt;a href="logout.php"&gt;KELUAR&lt;/a&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;&lt;td  colspan="5"&gt;
  &lt;hr&gt;
  NAMA: &lt;?php echo $info1['nama'];?&gt;&lt;br&gt;
  NOM.KP: &lt;?php echo $info1['idpeserta'];?&gt;&lt;br&gt;
  NOM.HP: &lt;?php echo $info1['nomhp'];?&gt;&lt;br&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td colspan="5"&gt;&lt;hr&gt;&lt;td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td colspan="5"&gt;
  KEPUTUSAN RASMI &lt;?php echo $kata1;?&gt;&lt;br&gt;
  TEMPAT: &lt;?php echo $win['tempat'];?&gt;&lt;br&gt;
  &lt;hr&gt;
  &lt;/center&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <hr />
  <p>line 48 : <code>TEMPAT: &lt;?php echo $win['tempat'];?&gt;&lt;br&gt;</code></p>
  <p>ive tried using isset and the error did go away but it just removed the message not actually &quot;fix&quot; it to work. HELPPP</p>