<?php
  
  $id=mysqli_real_escape_string($mysqli,$_GET["id"]);

  $qry=mysqli_query($mysqli,"SELECT * FROM berita WHERE id='$id'");

  
  if(mysqli_num_rows($qry)>0){
    
    
    $data=mysqli_fetch_array($qry);
      if(!empty($data["foto"])){
        $foto="<img src='foto_berita/$data[foto]' width='75%' height='75%' style=\"margin-left:15px\"/>";
      }else{
        $foto="";
      }

      $isiberita=str_replace("[!MORE]", "", $data["isi"]);
      
      echo "<h1>$data[judul]</h1>
            <p>Oleh: $data[penulis] - $data[tanggal]</p>
            <center>$foto</center><br/>
            <p>$isiberita</p>";
    echo "<br/><br/>";  
  }else{
    echo "<p>Maaf, Id berita tidak valid...</p>";
    
  }
?>